Comments (15)
Hi Mikael!
What a brilliant idea to let ruby export an environment variabel to the sub process with the updated filename. I will most definitely try it out today or tomorrow.
I had the same problem yesterday when using filewatcher to automatically run jslint on a set of javascript files.
Regards
Thomas Flemming :-)
Den 9. jan. 2013 kl. 09:53 skrev Maikel D [email protected]:
Hello,
I'm trying to write 1 script that can watch for my Jade, SCSS and CoffeeScript files and compile them on save.
Your filewatcher has got me there except for 1 obstacle, I can't tell which file was saved so I can re-compile it.
I don't use ruby, so I'm using this script from the command line. I run the following code:
filewatcher -r . "*.jade *.scss" "echo [X] updated"
All I need is for [x] to be replaced with the filename. Is that possible through your plugin?
I've tried a few different variable names (thought I might get lucky) but had no luck.—
Reply to this email directly or view it on GitHub.
from filewatcher.
It would be really handy and it will make your plugin much more powerful.
It might be a good idea to pass 3 variables, just for flexibility, for
example {filename}, {file_dir} and {filepath}. Where filename is only the
name, e.g. index.scss, file_dir is only the directory, e.g. ./css/ and
filepath is the full url, e.g. ./css/index.scss.
This will make your plugin very flexible :-)
I'm looking forward to see the update.
On 10 Jan 2013 01:14, "Thomas Flemming" [email protected] wrote:
Hi Mikael!
What a brilliant idea to let ruby export an environment variabel to the
sub process with the updated filename. I will most definitely try it out
today or tomorrow.I had the same problem yesterday when using filewatcher to automatically
run jslint on a set of javascript files.Regards
Thomas Flemming :-)Den 9. jan. 2013 kl. 09:53 skrev Maikel D [email protected]:
Hello,
I'm trying to write 1 script that can watch for my Jade, SCSS and
CoffeeScript files and compile them on save.Your filewatcher has got me there except for 1 obstacle, I can't tell
which file was saved so I can re-compile it.I don't use ruby, so I'm using this script from the command line. I run
the following code:filewatcher -r . "*.jade *.scss" "echo [X] updated"
All I need is for [x] to be replaced with the filename. Is that possible
through your plugin?
I've tried a few different variable names (thought I might get lucky)
but had no luck.—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-12045680.
from filewatcher.
Maikel, I'll implement all three environment variables when I have time. Hopefulle this evening.
If you are using bash, you would be able to do something like this:
$ filewatcher "*.scss" "sass $filename"
from filewatcher.
Yeah, that would be awesome.
Really looking forward to seeing it. Hopefully it's an easy thing for you to implement :)
from filewatcher.
By the way, about your gem package. Do you have to manually update it?
Because when I ran 'gem install filewatcher', I got version 0.1.5. Which was missing a lot of cool things, such as the --recurse flag. So I overwrote the content of that package (on my machine) with the content of the github repo.
I'm just curious if when you update github with a new version, the gem package is automatically updated.
from filewatcher.
I have committed a new version to both rubygems.org and github where FILENAME, FILEPATH and FILEDIR is available as environment variables. If you're using a unix like system you can use single quotes on the command string:
$ filewatcher *.js 'node $FILENAME'
Please let me know if it works for you. Please note that the documentation has been changed. I have to admit I haven't got the recurse option to work myself, I just merged a patch I got.
from filewatcher.
Awesome, I'm gonna test it now.
I hope being on Windows 8 doesn't present any random issues!
About the recurse option, that's what's great about open-source :) you get a very helpful community.
from filewatcher.
This is what I'm getting with single quotes:
$ filewatcher -r . "*.scss *.jade" 'echo $FILENAME $FILEPATH $FILEDIR changed'
$FILENAME $FILEPATH $FILEDIR changed
$FILENAME $FILEPATH $FILEDIR changed
And this is with double quotes:
$ filewatcher -r . "*.scss *.jade" "echo $FILENAME $FILEPATH $FILEDIR changed"
changed
changed
I'm using Windows 8, with Git Bash, which emulates a lot of the linux stuff.
Any ideas how to get around this?
from filewatcher.
Try without quotes around file patterns, like this;
$ filewatcher -r . *.scss *.jade 'echo $FILENAME $FILEPATH $FILEDIR changed'
Thomas Flemming
Den 11. jan. 2013 kl. 01:03 skrev Maikel D [email protected]:
This is what I'm getting with single quotes:
$ filewatcher -r . "*.scss *.jade" 'echo $FILENAME $FILEPATH $FILEDIR changed'
$FILENAME $FILEPATH $FILEDIR changed
$FILENAME $FILEPATH $FILEDIR changed
And this is with double quotes:$ filewatcher -r . "*.scss *.jade" "echo $FILENAME $FILEPATH $FILEDIR changed"
changed
changed
I'm using Windows 8, with Git Bash, which emulates a lot of the linux stuff.
Any ideas how to get around this?—
Reply to this email directly or view it on GitHub.
from filewatcher.
I got the same thing.
$ filewatcher -r . *.scss *.jade 'echo $FILENAME $FILEPATH $FILEDIR changed'
$FILENAME $FILEPATH $FILEDIR changed
$FILENAME $FILEPATH $FILEDIR changed
There's nothing wrong with the 'watching' of files, that happens just fine.
I did a tiny bit of research based on my tiny knowledge of ruby, and it seems that the ruby ENV variable isn't exposed to the system, or something like that?
I don't know if there's a workaround to get it working on Windows!
from filewatcher.
I' have a pc at work where I can test it later today.
-Thomas Flemming
Den 11. jan. 2013 kl. 02:38 skrev Maikel D [email protected]:
I got the same thing.
$ filewatcher -r . *.scss *.jade 'echo $FILENAME $FILEPATH $FILEDIR changed'
$FILENAME $FILEPATH $FILEDIR changed
$FILENAME $FILEPATH $FILEDIR changed
There's nothing wrong with the 'watching' of files, that happens just fine.
I did a tiny bit of research based on my tiny knowledge of ruby, and it seems that the ruby ENV variable isn't exposed to the system, or something like that?I don't know if there's a workaround to get it working on Windows!
—
Reply to this email directly or view it on GitHub.
from filewatcher.
Best of luck :)
from filewatcher.
Try using %FILENAME% in git bash.
Sendt fra min mobiltelefon, hilsen
Thomas Flemming
Den 11. jan. 2013 kl. 08:37 skrev Maikel D [email protected]:
Best of luck :)
—
Reply to this email directly or view it on GitHub.
from filewatcher.
That's awesome.
That works. Well done Thomas :)
On 12 January 2013 02:59, Thomas Flemming [email protected] wrote:
Try using %FILENAME% in git bash.
Sendt fra min mobiltelefon, hilsen
Thomas FlemmingDen 11. jan. 2013 kl. 08:37 skrev Maikel D [email protected]:
Best of luck :)
—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-12150287.
from filewatcher.
The documentation is updated. Closing...
from filewatcher.
Related Issues (20)
- The filewatch does not work if files are creating too fast HOT 5
- unexpected behavior on Windows and two callbacks on one DELETE on Linux HOT 3
- --restart flag support process kill with custom signal? HOT 3
- filewatcher loops infinitely when executing a script that invokes ssh HOT 9
- "Batching" all changes into one event HOT 3
- Sync to database example HOT 1
- Question regarding API HOT 3
- How do I know which directory has changed when there is a change HOT 1
- Stable release soon? HOT 2
- Filewatcher not found in Ruby 3.2.2 HOT 13
- When used with multiple watch paths block vars are improperly assigned HOT 5
- Speed up tests HOT 1
- `Filewatcher` vs `FileWatcher` case change from rubygems HOT 4
- 1.0 Release -- event 'updated' raises NotImplementedError HOT 4
- Crash on file deletion (via executable) HOT 1
- Doesn't seem to work if repos have a dot in the name HOT 2
- Replace Gemnasium with Depfu
- Trollop dependency is deprecated HOT 9
- Switch from Travis CI to Cirrus CI HOT 1
- Detect rename HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filewatcher.