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

grunt init bower task fails if space in directory name (and as a result /ghost/signup page appears blank) #3206

Closed
jamesmartinduffy opened this issue Jul 6, 2014 · 9 comments · Fixed by #3653 or #3700
Assignees
Labels
bug [triage] something behaving unexpectedly

Comments

@jamesmartinduffy
Copy link

Hey guys,

Just cloned a fresh copy of the repo to start on some theme development, and ran into this issue. Basically after following the install steps and navigating to /ghost/signup, I was served with a blank page. After looking into it, it appears to be caused by grunt init's "shell:bower" task failing due to my local directory having a space in it.

$ grunt init -v

...

Running "shell:bower" (shell) task
Verifying property shell.bower exists in config...OK
File: [no files]
Options: stdout, stderr=false, stdin, failOnError=false
Command: /Users/jamesduffy/Dropbox (Personal)/_Development/duffx.com/node_modules/.bin/bower install
Options: stdout, stderr=false, stdin, failOnError=false
/bin/sh: -c: line 0: syntax error near unexpected token `Personal'
/bin/sh: -c: line 0: `/Users/jamesduffy/Dropbox (Personal)/_Development/duffx.com/node_modules/.bin/bower install'

After moving the file to a directory with no space, grunt init works fine.

Not sure if it's within the Ghost team's power to fix or if this is an issue with the bower module, but figured I'd open an issue in case other people are having this problem in the future.

@novaugust
Copy link
Contributor

Man, awesome, thanks for figuring this out. We just had someone come into IRC because their bower init never worked; this was almost certainly the problem.

Cheers

ErisDS added a commit to ErisDS/Ghost that referenced this issue Aug 6, 2014
closes TryGhost#3206

- We were escaping paths for the bower commands, but this didn't work on
  windows
- Use the same pattern for the coverage command
@ErisDS ErisDS self-assigned this Aug 6, 2014
@ErisDS ErisDS added the bug label Aug 6, 2014
@ErisDS ErisDS added this to the 0.5 Multi-user milestone Aug 6, 2014
@ErisDS
Copy link
Member

ErisDS commented Aug 6, 2014

I thought we had this fixed, seems it was broken on Windows still. I have a fix which I'm currently testing cross platform.

@jamesmartinduffy just an FYI, when raising issues please include details of your environment. To help you know what sort of info to include we have a bug reporting template in the contributing guidelines.

@jamesmartinduffy
Copy link
Author

Sorry – this is running locally on OS X 10.9.4, node v0.10.21, and Ghost 0.4.2.

@jamesmartinduffy
Copy link
Author

This did not fix it for me.

Running "shell:bower" (shell) task
Verifying property shell.bower exists in config...OK
File: [no files]
Options: stdout, stderr, stdin, failOnError
Command: /Users/jamesduffy/Dropbox\ (Personal)/_Development/Ghost/node_modules/.bin/bower --allow-root install
/bin/sh: -c: line 0: syntax error near unexpected token `Personal'
/bin/sh: -c: line 0: `/Users/jamesduffy/Dropbox\ (Personal)/_Development/Ghost/node_modules/.bin/bower --allow-root install'
Warning: Command failed: /bin/sh: -c: line 0: syntax error near unexpected token `Personal'
/bin/sh: -c: line 0: `/Users/jamesduffy/Dropbox\ (Personal)/_Development/Ghost/node_modules/.bin/bower --allow-root install'
 Use --force to continue.

Aborted due to warnings.

Same error. Perhaps its due to having parentheses in the path?

I just pulled the latest, last commit is bf3078c, Ghost version 0.5.0-rc2. Again, I'm on OSX 10.9.4.

@sebgie
Copy link
Contributor

sebgie commented Aug 8, 2014

I have tested on OSX 10.9.4 and it shows the following output:

Running "init" task

Running "shell:bower" (shell) task
Verifying property shell.bower exists in config...OK
File: [no files]
Options: stdout, stderr, stdin, failOnError
Command: /Users/sebi/Development/sebgie/Ghost\ XX/node_modules/.bin/bower --allow-root install

Running "shell:ghost_ui" (shell) task

But I guess that the brackets are causing another (similar) problem. //cc: @ErisDS

Update: confirmed

Running "shell:bower" (shell) task
/bin/sh: -c: line 0: syntax error near unexpected token `Personal'
/bin/sh: -c: line 0: `/Users/sebi/Development/sebgie/Ghost\ (Personal)/node_modules/.bin/bower --allow-root install'
Warning: Command failed: /bin/sh: -c: line 0: syntax error near unexpected token `Personal'
/bin/sh: -c: line 0: `/Users/sebi/Development/sebgie/Ghost\ (Personal)/node_modules/.bin/bower --allow-root install'
 Use --force to continue.

@sebgie sebgie reopened this Aug 8, 2014
@jamesmartinduffy
Copy link
Author

Looks like parentheses do need to be escaped, since running this command works fine:

/Users/jamesduffy/Dropbox\ \(Personal\)/_Development/Ghost/node_modules/.bin/bower --allow-root install

But I may be in the minority here having that in my path. I have ~/dev symlinked to Dropbox (Personal)/_Development/, which is possibly why I've never run into this before.

Is there a reason for not just using a relative path instead of process.cwd()? ./node_modules/.bin/bower --allow-root install executes just fine. (Also needs to be changed for ghost_ui and coverage).

@ErisDS
Copy link
Member

ErisDS commented Aug 8, 2014

@jamesmartinduffy Hopefully #3700 will fully resolve the issue for you? (I've tested on win and mac)

@jamesmartinduffy
Copy link
Author

Yes, that resolves it.

@ErisDS
Copy link
Member

ErisDS commented Aug 8, 2014

Wooooooooooooooooooooooooooooooooooooo 🎈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
4 participants