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

Syntax error #3

Closed
underscore-ex opened this issue May 11, 2022 · 6 comments
Closed

Syntax error #3

underscore-ex opened this issue May 11, 2022 · 6 comments

Comments

@underscore-ex
Copy link

Got this error

❯ ./setup.sh
zsh: permission denied: ./setup.sh

~/repos/Git_SSH-Account_Switch-main : sudo chmod +x setup.sh
Password:

~/repos/Git_SSH-Account_Switch-main : ./setup.sh
/Users/xyz/.git-acc: line 4: syntax error near unexpected token `('
/Users/xyz/.git-acc: line 4: `  local function Echo_Color(){'
Done!! Now can use! Enjoy~~~
@tw-yshuang
Copy link
Owner

Hi, I think the problem is because ./setup.sh needs to be executed by bash, so you can follow the command that I mentioned on README.md:

$ bash ./setup.sh

I hope it can help you.

@Ojasv-Singh-Zeotap
Copy link

Ojasv-Singh-Zeotap commented May 17, 2022

image

image

Getting this error even with bash @tw-yshuang

@tw-yshuang
Copy link
Owner

I will fix this issue, thank you!

@tw-yshuang tw-yshuang reopened this May 18, 2022
tw-yshuang added a commit that referenced this issue May 18, 2022
fix:
    fix issue: Syntax error #3
mod:
    add the step hint when an unknown $profile happens.
@tw-yshuang
Copy link
Owner

I fixed this issue and released v1.2.0, go to check it out!!

@wcarrasc
Copy link

Hello! I cloned repo and downloaded 1.2.0 and having the same error with both ways:

bash ./setup.sh You have already added git-acc config in /Users/walthercarrasco/.zshrc !! Only update your git-acc! /Users/walthercarrasco/.git-acc: line 4: syntax error near unexpected token ('
/Users/walthercarrasco/.git-acc: line 4: local function Echo_Color(){' Done!! Now can use! Enjoy~~~

@tw-yshuang
Copy link
Owner

This error is different from the previous issue, in the setup.sh, I design a mechanism that can detect whether the current machine has been installed or not, if it's installed, then this script will only update git-acc, and this error is because I'm using bash to execute source git-acc in the setup.sh (it is a bad idea, ha!), and bash can not recognize zsh syntax, but it is not causing any problem if you reopen another terminal, this is a good problem to mention it, I will turn setup.sh to zsh when I have free time, thanks!

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

4 participants