Closed dizzib closed 11 years ago
If you always import bar.sass into into foo.sass, why aren't you using the following syntax:
foo.sass _bar.sass
then _bar.sass is recognized as a partial of foo.sass and should be imported and watched correct by guard:sass
@dizzib could you post your Guardfile?
Thanks guys!
@it-consulting-lorenz same issue if I rename bar.sass to _bar.sass. The sass watcher seems happy in either case.
@hawx here's my guardfile:
guard 'sass',
:input => 'build-src/sass',
:output => 'build'
btw I've edited my original contrived example to match with this guardfile, hope it makes sense.
You're using an outdated version of guard-sass, try updating to 1.0.1 and see if that works ok.
Unfortunately after updating I'm getting this error whenever I amend foo.sass:
15:04:31 - ERROR - Guard::Sass failed to achieve its <run_on_changes>, exception was:
> [#] Errno::ENOENT: No such file or directory - build-src/sass/foo.sass
> [#] /home/andy/.gem/ruby/1.9.1/gems/guard-sass-1.0.1/lib/guard/sass/runner.rb:78:in `read'
Strange thing is it's successfully detecting the change to the file which is definitely there !
guard v1.5.4 guard-sass v1.0.1 listen v0.5.3
Strange. So your directory setup is like:
.
├── Gemfile
├── Gemfile.lock
├── Guardfile
├── build
│ ├── bar.css
│ └── foo.css
└── build-src
└── sass
├── bar.sass
└── foo.sass
Then you run bundle exec guard
from inside this. guard detects the change but guard-sass can't read the file.
Are you sure the path from where the command is run to the file is /build-src/sass/foo.sass
, or are you running the command from somewhere else?
Your last reply pointed me in the right direction. Turns out I was cd'ing into my scripts directory and running Guard from there.
I'm very happy to report relative import paths are now working when I run Guard from ~/ using the -G (guardfile) option :)
Thanks for your time, really appreciated!
I have 2 files in the /build-src/sass directory:
where foo.sass imports bar:
Guard-sass generates a 'Syntax Error: File to import not found or unreadable' error when foo.sass changes. It only works if I add /build-src/sass as a loadpath.
Interestingly the sass watcher works as expected:
and is also happy with either of these import directives:
This suggests the problem might be with guard-sass.
guard-sass v0.5.4 sass v3.2.1, v3.1.15
Cheers!