Unable to run script


#1

Trying to run the following script:

#!/bin/sh
if [ -z "$1" ]
then
  echo "Which folder do you want to deploy to GitHub Pages?"
  exit 1
fi
git subtree push --prefix $1 origin gh-pages

I get a permission denied when running ./gh-deploy.sh docs

Thoughts?


#2

The file probably misses executable attribute. Try running

chmod +x gh-deploy.sh

to make gh-deploy.sh file executable


#3

Hey @shadowcodex,

Try @harutyun’s tip first and then…

I know it’s not best practice and I’ll likely get yelled at for recommending this but… just pop a sudo in there like: sudo ./gh-deploy.sh docs

I do it all the time… :blush:
(it’ll work…) :anguished:


#4

Yeah that worked. Thanks so much!