Skip to content

Instantly share code, notes, and snippets.

@atlefren
Created February 13, 2014 20:07
Show Gist options
  • Select an option

  • Save atlefren/8982824 to your computer and use it in GitHub Desktop.

Select an option

Save atlefren/8982824 to your computer and use it in GitHub Desktop.
initjs
#!/bin/sh
#inits an empty git repo with an empty .gitignore, readme.md and src, lib and test folder
#then it runs npm init
if [ -n "$1" ]; then
echo $1
if [ ! -d "$1" ]; then
name=$1
git init $name
cd $name
touch .gitignore
touch readme.md
echo $name > readme.md
mkdir lib
mkdir src
mkdir test
npm init
else
echo "$1 exists"
fi
else
echo "provide a name as first arg"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment