Kode / khamake

Kha's build tool.
http://kha.tech
15 stars 43 forks source link

Chokidar ignore assets and shaders when the path contains a "." #142

Closed Nazariglez closed 6 years ago

Nazariglez commented 6 years ago

this line in AssetsConverter and ShaderCompiler: this.watcher = chokidar.watch(match, { ignored: /[\/\\]\./, persistent: watch });

Is ignoring paths like this lel/.lol/lel.md because the /. in the path. If the regex is changed to /\.[\/\\]/ works, i don't send you a pull request because i don't know what type of paths you want to ignore with this regex, if you tell me what kind of paths want to ignore i can try to make a regex to ignore them and works with path contains . on unix and send you a pr.

/Users/nazarigonzalez/.gecko/Kha/Sources/kha/graphics4/Graphics2.hx:1099: characters 32-58 : Class<kha.Shaders> has no field painter_image_vert
/Users/nazarigonzalez/.gecko/Kha/Sources/kha/graphics4/Graphics2.hx:1117: characters 34-62 : Class<kha.Shaders> has no field painter_colored_frag
/Users/nazarigonzalez/.gecko/Kha/Sources/kha/graphics4/Graphics2.hx:1118: characters 32-60 : Class<kha.Shaders> has no field painter_colored_vert
/Users/nazarigonzalez/.gecko/Kha/Sources/kha/graphics4/Graphics2.hx:1137: characters 34-59 : Class<kha.Shaders> has no field painter_text_frag
/Users/nazarigonzalez/.gecko/Kha/Sources/kha/graphics4/Graphics2.hx:1138: characters 32-57 : Class<kha.Shaders> has no field painter_text_vert
/Users/nazarigonzalez/.gecko/Kha/Sources/kha/graphics4/Graphics2.hx:817: characters 34-60 : Class<kha.Shaders> has no field painter_video_frag
/Users/nazarigonzalez/.gecko/Kha/Sources/kha/graphics4/Graphics2.hx:818: characters 32-58 : Class<kha.Shaders> has no field painter_video_vert
/Users/nazarigonzalez/.gecko/Sources/gecko/render/BlendMode.hx:56: characters 40-66 : Class<kha.Shaders> has no field painter_image_frag
/Users/nazarigonzalez/.gecko/Sources/gecko/render/BlendMode.hx:57: characters 38-64 : Class<kha.Shaders> has no field painter_image_vert
RobDangerous commented 6 years ago

It is supposed to ignore hidden Unix paths (aka everything which includes a dirname which starts with a dot). This is mainly for .git directories to make things easier for chokidar but it's so common to put tons of stuff in .something dirs that I ignore all of it. Do you really want a hidden lol path?

Nazariglez commented 6 years ago

hahaha not a hidden "lol" path, but for example, i'm using npm to install gecko and some people use nvm to manage versions of node, nvm for example use a path named /home/user/.nvm/versions/node/etc... like /home/rzial/.nvm/versions/node/v9.11.1/lib/node_modules/gecko2d/Kha. When they try to compile with the command line, which uses khamake/out/main.js -> run, the compilation fails.

I don't know what can i do to fix this if every path hidden is ignored.

RobDangerous commented 6 years ago

That's unfortunate. OK, let's change it to ignore only .git then.

Nazariglez commented 6 years ago

I'll send you a pr tomorrow, thanks Robert!

Nazariglez commented 6 years ago

Hi @RobDangerous, this is just a ping :P do you think this pr can be merged?

RobDangerous commented 6 years ago

Yes, I think so.

Nazariglez commented 6 years ago

thanks