hlashbrooke/WordPress-Plugin-Template

Build script fails

orweinberger opened this issue · 7 comments

Tried running the build script, getting an error message:

$ sh build-plugin.sh 
Plugin name: test123
Destination folder: test123
Include Grunt support (y/n): y
Initialise new git repo (y/n): y
build-plugin.sh: 16: build-plugin.sh: Bad substitution

Could you provide more info? I just installed this with the build script and had no issues. Did it on Mac 10.10 running command:
$ ./build-plugin.sh
Plugin name: name
Destination folder:
Include Grunt support (y/n): n
Initialise new git repo (y/n): n

The files were already in my plugins folder which is why I left the destination folder line blank.. Permissions on my folder was: User R&W, everyone R

I got the same error on Ubuntu 12.04

@kevinohashi

See here:
#19

Try editing line 24 in the build script. I'm on an Ubuntu derivative.

Oops - this might be another issue altogether. Sorry for the noise!

It's Ubuntu bash/dash specific error
Give your user exec rights on the file:

chmod +x build-plugin.sh

and execute it like:

./build-plugin.sh

Worked here
(the same could be acomplished by using "bash" instead of "sh" when executing the build file)

I encountered this same issue on an Ubuntu machine. The solution from @DiegoYungh worked for me.

Perhaps the build script could be modified to be more OS agnostic, or deal with common nuances such as this one, as this fails on the latest LTS Ubuntu and also on Raspbian.

Failing on 2 separate Debian based distros makes me think this same thing would probably happen with other OSs built from a Debian base.

Thanks @DiegoYungh, that worked for me on Lubuntu 16.10_Yakkety_Yak
Note use ./build-plugin.sh not sudo sh build-plugin.sh once applied privliges chmod +x build-plugin.sh