zdharma-continuum / null

MIT License
5 stars 8 forks source link

The existence of this repo feels really hacky #1

Open alichtman opened 2 years ago

alichtman commented 2 years ago
# The invocation uses https://github.com/zdharma/null repo as a placeholder
# for the atclone'' and atpull'' hooks

zplugin ice as"program" pick"$ZPFX/sdkman/bin/sdk" id-as'sdkman' run-atpull \
  atclone"wget https://get.sdkman.io -O scr.sh; SDKMAN_DIR=$ZPFX/sdkman bash scr.sh" \
  atpull"SDKMAN_DIR=$ZPFX/sdkman sdk selfupdate" \
  atinit"export SDKMAN_DIR=$ZPFX/sdkman; source $ZPFX/sdkman/bin/sdkman-init.sh"
zplugin light zdharma/null

If we don't want to do a potentially complicated re-engineering, we can just add special handling for zinit light NULL or something, but I'd prefer to see a properly engineered solution.

luong-komorebi commented 2 years ago

Utterly agree with you on this :)

chuan137 commented 2 years ago

Totally agree. Would be nice to have a simpler API handling the local scripts, sth like zinit light $local_dir, and make the $local_dir as working directory of the ices. The above example could be simplified to sth like

zinit for \
  as"program" pick"bin/sdk" \
  atclone"wget https://get.sdkman.io -O scr.sh; bash scr.sh" \
  atpull"sdk selfupdate"\
  atinit"source bin/sdkman-init.sh" \
  light-mode sdkman
turboBasic commented 2 years ago

@chuan137 I think some extra command line option is required as $local_dir might conflict with static mapping of some Github repos to single word tokens (see here)

PS: as an afterthought I realised that it would fly if $local_dir is absolute path i.e. starts with /