withfig / fig

Public issue tracker for Fig.
https://fig.io
MIT License
2.05k stars 63 forks source link

Calling Shell Alias leads to fig 'Script not found' error #2465

Open van-adam opened 1 year ago

van-adam commented 1 year ago

Checks

Operating system

macOS 13.3.1 (22E261)

Expected behaviour

Fig should execute my script I created in fig UI when called via shell alias (after successfully running fig source). fig command: fig run commit-pr shell alias: commit-pr

Actual behaviour

Via fig command, the script is executed just fine but via the shell alias I get: error: Script not found

Steps to reproduce

  1. Create a custom script in fig UI
  2. Add a shell alias to the script
  3. Run fig source
  4. Call shell alias

Environment

fig-details:
  - 2.15.0
hardware-info:
  - model: 
  - model-id: 
  - chip-id: Apple M1 Pro
  - cores: 10
  - mem: 32.00 GB
os-info:
  - macOS 13.3.1 (22E261)
environment:
  - shell: /bin/zsh
  - terminal: terminal
  - cwd: /Users/username
  - exe-path: /opt/homebrew/bin/fig
  - install-method: brew
  - env-vars:
    - FIGTERM_SESSION_ID: cfdc4617-7d9e-45bf-9f1e-fb01f998cb8c
    - FIG_SET_PARENT_CHECK: 1
    - FIG_TERM: 2.15.0
    - PATH: /Users/username/opt/anaconda3/bin:/Users/username/opt/anaconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/username/.fig/bin:/Users/username/.local/bin:/Users/username/Library/Application Support/JetBrains/Toolbox/scripts
    - SHELL: /bin/zsh
    - TERM: xterm-256color
    - __CFBundleIdentifier: com.apple.Terminal
    - FIG_PID: 5882
    - FIG_SET_PARENT: cfdc4617-7d9e-45bf-9f1e-fb01f998cb8c
mschrage commented 1 year ago

Did you potentially change the name of your script after creating the alias?

van-adam commented 1 year ago

I recall that updating the script in fig didn't effectively change it's behaviour when called from command line so I made a copy under a different name. However, the original script commit-pr was not renamed. What course of action are you proposing? Deleting the shell alias didn't work for me. Should I delete and create the script from scratch?