pebblex
pebblex copied to clipboard
determine sdk path even if symlink is relative (e.g. when using brew)
I've installed Pebble SDK using brew.
which pebble
returns /usr/local/bin/pebble
.
readlink /usr/local/bin/pebble
returns ../Cellar/pebble-sdk/3.4/bin/pebble
and the relative path is compared to current working directory instead of the symlink. Which is wrong.
This PR should fix it.
Hey @xxdavid,
I tried to apply your patch by manually changing both files located at /Library/Ruby/Gems/2.0.0/gems/pebblex-0.0.7/ after I installed pebblex using gem but it seems to do nothing. Tried to rebuild the gem using pristine command but this seems to revert my changes. I never used Ruby/gem before, could you please point me in the right direction to get your changes working? Thanks!
Hey @silasg,
I'm not really a Ruby guy neither but I think this should work.
Uninstall the gem version – gem uninstall pebblex
Clone my fork – git clone https://github.com/xxdavid/pebblex
cd pebblex
git checkout fix-relative-symlink
If you don't have Rake, you should probably install it – (sudo) gem install rake
Build pebblex – rake build
And finally install it – sudo rake install
Hope it helps. Happy Christmas!
@xxdavid Thanks a lot for your support! I had to install bundler and rspec but then I was able to build the gem. Unfortunately I still get the following error (plus stacktrace) when trying to build in xcode:
/Library/Ruby/Gems/2.0.0/gems/pebblex-0.0.7/lib/pebble_x/cli.rb:82:in `pebble_cmd': Cannot find 'pebble' command at /Users/silasg/Downloads/Cellar/pebble-sdk/4.0/bin/pebble. (ArgumentError)
Note that the given path to pebble
executable is (of course) wrong:
$ ls -l `which pebble`
lrwxr-xr-x 1 silasg admin 35 Dec 16 18:04 /usr/local/bin/pebble -> ../Cellar/pebble-sdk/4.0/bin/pebble
I wonder why this could happen because in /pebble_x/cli.rb:62 which is called to get the location of pebble
executable. Do you have any other idea? Thanks a lot -- even if not -- for your help and merry christmas of course!
Silas
@silasg, and do you have this on line 65 in /Library/Ruby/Gems/2.0.0/gems/pebblex-0.0.7/lib/pebble_x/cli.rb
?
@xxdavid yes I have.
And in fact my very first try was to add the lines from your patch manually without rebuilding the gem.
That's strange. Have you tried to recreate the Xcode project?
That did the trick. Thanks a lot!