deta / deta-cli

Legacy Deta CLI. Repository is now archived.
https://deta.space
MIT License
67 stars 13 forks source link

Command not found after failed `new` #61

Closed persello closed 3 years ago

persello commented 3 years ago

Hello, After an error, deta-cli seems to delete its bin folder. Please have a look at my shell history:

Step 1: Installing deta-cli:

riccardo@MacBook-Pro-di-Riccardo-M1 ~ % curl -fsSL https://get.deta.dev/cli.sh | sh
######################################################################## 100,0%######################################################################### 100,0%
Archive:  /Users/riccardo/.deta/bin/deta.zip
  inflating: deta                    
  inflating: ._deta                  
Deta was installed successfully to /Users/riccardo/.deta/bin/deta
Run 'deta --help' to get started

Step 2: some quick checks after installation

riccardo@MacBook-Pro-di-Riccardo-M1 ~ % echo $PATH
/Users/riccardo/.deta/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/riccardo/.cargo/bin
riccardo@MacBook-Pro-di-Riccardo-M1 ~ % ls -al .deta
total 0
drwxr-----   3 riccardo  staff    96  6 Set 19:54 .
drwxr-xr-x+ 44 riccardo  staff  1408  6 Set 19:51 ..
drwxr-xr-x   4 riccardo  staff   128  6 Set 19:54 bin
riccardo@MacBook-Pro-di-Riccardo-M1 ~ % ls -al .deta/bin
total 26720
drwxr-xr-x  4 riccardo  staff       128  6 Set 19:54 .
drwxr-----  3 riccardo  staff        96  6 Set 19:54 ..
-rw-r--r--  1 riccardo  staff       211  7 Lug 13:07 ._deta
-rwxr-xr-x  1 riccardo  staff  13675296  7 Lug 13:07 deta

Step 3: Try to call new without being logged in

riccardo@MacBook-Pro-di-Riccardo-M1 ~ % deta new --python --name test
Error: no auth token found, login with deta login or provide access token

Step 4: Command not found

riccardo@MacBook-Pro-di-Riccardo-M1 ~ % deta
zsh: command not found: deta

Step 5: Post-error checks

The .deta/bin folder is not there anymore. $PATH is fine.

riccardo@MacBook-Pro-di-Riccardo-M1 ~ % ls -al .deta/bin             
ls: .deta/bin: No such file or directory
riccardo@MacBook-Pro-di-Riccardo-M1 ~ % ls -al .deta                 
total 0
drwxr-----   2 riccardo  staff    64  6 Set 19:54 .
drwxr-xr-x+ 45 riccardo  staff  1440  6 Set 19:54 ..
riccardo@MacBook-Pro-di-Riccardo-M1 ~ % echo $PATH
/Users/riccardo/.deta/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/riccardo/.cargo/bin

System details

OS: macOS 12.0 21A5506j arm64 
Host: MacBookPro17,1 
Kernel: 21.1.0 
Uptime: 9 hours, 50 mins 
Packages: 5 (brew) 
Shell: zsh 5.8 
Terminal: Apple_Terminal 
CPU: Apple M1 
GPU: Apple M1 
Memory: 1219MiB / 8192MiB 
abdelhai commented 3 years ago

Hi @persello, thanks for reporting this! We will take a look at this.