Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smartcd export doesn't work. #69

Open
71walceli opened this issue Sep 27, 2024 · 0 comments
Open

smartcd export doesn't work. #69

71walceli opened this issue Sep 27, 2024 · 0 comments

Comments

@71walceli
Copy link

Whenever trying to export enter and leave scripts, it gives me bash: ${${entry%/}##*/}: bad substitution

My scripts:

~/path/to/folder$ smartcd show enter
# ---8<--- begin /home/user/.smartcd/scripts/home/user/path/to/folder/bash_enter
alias djangoShell='docker compose exec django bash -c "python manage.py shell"'
alias djangoMigrate='docker compose exec django bash -c "python manage.py makemigrations && python manage.py migrate"'
function djangoBash() {
  docker compose exec django bash -c "${@}"
}
function push() {
  for image in $(docker image ls ghcr.io/71walceli/uae_tesis_ccmangos_* | awk '{print $1":"$2}'); do
    docker push $image
  done
}
# ---8<--- end /home/user/.smartcd/scripts/home/user/path/to/folder/bash_enter
~/path/to/folder$ smartcd show leave
# ---8<--- begin /home/user/.smartcd/scripts/home/user/path/to/folder/bash_leave
unalias djangoShell
unalias djangoMigrate
unset -f djangoBash
unset -f push

# ---8<--- end /home/user/.smartcd/scripts/home/user/path/to/folder/bash_leave
~/path/to/folder$ 

Expected behaviour

smartcd should be able to export the contents of /home/user/.smartcd/scripts/home/user/path/to/folder/bash_* for every declared script, without issues, regardless of content.

Actual behaviour

$ smartcd export 
smartcd export 1.0
bash: ${${entry%/}##*/}: bad substitution

I don't know if it has to do with having functions

Workaround

I think it's possible to get my scripts by copying $HOME/.smartcd/scripts/path/to/folder, which I'm strongly considering, FOr importing, copying into targer scripts dir. Is that a good idea?

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

No branches or pull requests

1 participant