daneah / iterm-components

:computer: Custom status bar components for use with iTerm2
https://www.iterm2.com/3.3/documentation-status-bar.html
MIT License
69 stars 9 forks source link

Autolaunch fails: script failed / ended unexpectedly / Too many levels of symbolic links #15

Closed RustyPedrosa closed 2 years ago

RustyPedrosa commented 4 years ago

Looks like a symlink issue.

Installation: (note- I had copied generic_command earlier)

epedrosa@3Y:~/git$ git clone https://github.com/daneah/iterm-components.git
Cloning into 'iterm-components'...
remote: Enumerating objects: 144, done.
remote: Total 144 (delta 0), reused 0 (delta 0), pack-reused 144
Receiving objects: 100% (144/144), 283.85 KiB | 2.87 MiB/s, done.
Resolving deltas: 100% (72/72), done.
epedrosa@3Y:~/git$ cd iterm-components/
epedrosa@3Y:~/git/iterm-components$ ./install.sh
Linking scripts to AutoLaunch folder /Users/epedrosa/Library/Application Support/iTerm2/Scripts/AutoLaunch
Linking WIP_environment_variable.py...
Linking generic_command.py...
replace /Users/epedrosa/Library/Application Support/iTerm2/Scripts/AutoLaunch/generic_command.py? y
Linking github_stars.py...
Linking hello_world.py...
Linking kubectl_context.py...
Linking pyenv.py...
Linking rvm_gemset.py...

Selected scripts | autolaunch | hello_world.py... Log:

3/21, 4:50:43.745 PM: /bin/bash -c /Users/epedrosa/Applications/iTerm.app/Contents/Resources/it2_api_wrapper.sh /Users/epedrosa/Library/ApplicationSupport/iTerm2/iterm2env/versions/3.8.0/bin/python3 /Users/epedrosa/Library/ApplicationSupport/iTerm2/Scripts/Autolaunch/hello_world.py
3/21, 4:50:43.764 PM: + unset PYTHONPATH
3/21, 4:50:43.764 PM: + export PYTHONUNBUFFERED=1
3/21, 4:50:43.764 PM: + PYTHONUNBUFFERED=1
3/21, 4:50:43.764 PM: + /Users/epedrosa/Library/ApplicationSupport/iTerm2/iterm2env/versions/3.8.0/bin/python3 /Users/epedrosa/Library/ApplicationSupport/iTerm2/Scripts/Autolaunch/hello_world.py
3/21, 4:50:43.810 PM: /Users/epedrosa/Library/ApplicationSupport/iTerm2/iterm2env/versions/3.8.0/bin/python3: can't open file '/Users/epedrosa/Library/ApplicationSupport/iTerm2/Scripts/Autolaunch/hello_world.py': [Errno 62] Too many levels of symbolic links
3/21, 4:50:43.810 PM: 
3/21, 4:50:43.810 PM: ** Script exited with status 2 **

Replaced link with copy of script

epedrosa@3Y:~/git/iterm-components$ rm ~/Library/ApplicationSupport/iTerm2/Scripts/Autolaunch/hello_world.py
epedrosa@3Y:~/git/iterm-components$ cp hello_world.py ~/Library/ApplicationSupport/iTerm2/Scripts/Autolaunch/

Runs successfully now.

3/21, 4:52:42.385 PM: /bin/bash -c /Users/epedrosa/Applications/iTerm.app/Contents/Resources/it2_api_wrapper.sh /Users/epedrosa/Library/ApplicationSupport/iTerm2/iterm2env/versions/3.8.0/bin/python3 /Users/epedrosa/Library/ApplicationSupport/iTerm2/Scripts/Autolaunch/hello_world.py
3/21, 4:52:42.411 PM: + unset PYTHONPATH
3/21, 4:52:42.411 PM: + export PYTHONUNBUFFERED=1
3/21, 4:52:42.411 PM: + PYTHONUNBUFFERED=1
3/21, 4:52:42.411 PM: + /Users/epedrosa/Library/ApplicationSupport/iTerm2/iterm2env/versions/3.8.0/bin/python3 /Users/epedrosa/Library/ApplicationSupport/iTerm2/Scripts/Autolaunch/hello_world.py
3/21, 4:52:42.845 PM: Connection accepted: Script launched by user action
daneah commented 4 years ago

This may have changed in a newer version if iTerm. I don't think we want to have to copy all the scripts over, as the symlinking is meant to make sure the scripts are in sync with the repository. Copying them over is an okay workaround for the moment, but I'd like to see if we can get around that. I'm not sure I'll have time soon to check this out, but if you find out more in the meantime I'd love to hear about it here!