Skip to content

smartcd export doesn't work. #69

@71walceli

Description

@71walceli

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions