Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

xclisten doesn't seem to be picking up file changes #20

Open
fatuhoku opened this issue Aug 7, 2014 · 4 comments
Open

xclisten doesn't seem to be picking up file changes #20

fatuhoku opened this issue Aug 7, 2014 · 4 comments

Comments

@fatuhoku
Copy link

fatuhoku commented Aug 7, 2014

Say I run xclisten -d ipad_air -s MyLovelySpecs. This seemingly picks up the first edit and runs the tests, but does not pick up the rest of the edits. In fact, I have to wait about 3 minutes before it runs the next round of tests.

Why is this?

@fatuhoku
Copy link
Author

fatuhoku commented Aug 7, 2014

Well here's a clue. I've got my xclisten producing the command line:

xcodebuild -workspace XXX.xcworkspace -scheme XYZ -sdk iphonesimulator -destination 'name=iPad Air' test 2> xcodebuild_error.log | xcpretty -tc

But I suspected that something wasn't going quite right after the first run. So I ran it twice manually.

result?

$ xcodebuild -workspace XXX.xcworkspace -scheme XYZ -sdk iphonesimulator -destination 'name=iPad Air' test 2> xcodebuild_error.log | xcpretty -tc
........................................
$ xcodebuild -workspace XXX.xcworkspace -scheme XYZ -sdk iphonesimulator -destination 'name=iPad Air' test 2> xcodebuild_error.log | xcpretty -tc
zsh: file exists: xcodebuild_error.log

This is because zsh trying to be clever, protecting you from unintended overwrites. the zsh way of expressing 'overwrite' is >!, as in...

$ xcodebuild -workspace XXX.xcworkspace -scheme XYZ -sdk iphonesimulator -destination 'name=iPad Air' test 2>! xcodebuild_error.log | xcpretty -tc

However, this doesn't really work for bash.

@fatuhoku
Copy link
Author

fatuhoku commented Aug 7, 2014

Ah... so I found something that will work with both shells. >| overrides the noclobber option.

@fatuhoku
Copy link
Author

fatuhoku commented Aug 9, 2014

As a temporary workaround for xclisten not behaving:

fswatch -o $PROJECT_DIRECTORY | xargs -n1 -I{} xcodebuild -workspace WORKSPACE.workspace -scheme SCHEME -sdk iphonesimulator -destination 'name=iPad Air' test 2>| xcodebuild_error.log | xcpretty -c

Seems to work fine.

@supermarin
Copy link
Owner

@fatuhoku sorry for the delay on this, I was on the vacation.

Do you mind sending a PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants