Skip to content

Instantly share code, notes, and snippets.

@azu
Last active April 8, 2020 00:53
Show Gist options
  • Save azu/09dd6f27f52e2e8d9978 to your computer and use it in GitHub Desktop.
Save azu/09dd6f27f52e2e8d9978 to your computer and use it in GitHub Desktop.
node-init.sh

開発セットアップパターン

Dependencies

Usage

# ghqディレクトリにhogeを作ってhogeへ移動
mkdev hoge
# git, npm, license init
init-node.sh
### Development... ###
# Githubリポジトリを作成
hub create -d "description"
# git push -uのスクリプト
git pushup
# git pushupで、初めてリポジトリにpushするときに自動的にブランチをpush -uしてくれる
[alias]
pushup = "!gitbranchname() { git symbolic-ref --short HEAD; }; gitpushupstream() { git push --set-upstream origin `gitbranchname`; }; gitpushupstream"
mkdev () {
if [ ! -n "$1" ]
then
echo "Usage: mkdev dir-name"
return
fi
local dirName=$1
local rootDir=$(ghq root)
local githubUser="github.com/$(git config user.name)"
if [[ dirName = */* ]]
then
githubUser = "github.com"
fi
local devPath="${rootDir}/${githubUser}/${dirName}"
mkdir -p ${devPath}
cd ${devPath}
}
#!/bin/bash
git init
# https://github.com/simonwhitaker/gibo
gibo Node JetBrains >> .gitignore
# https://github.com/blaix/license-generator
licgen MIT azu
touch README.md
# create dir
mkdir test
mkdir lib
mkdir src
# create package.json
# https://github.com/azu/init-package-json-parcel
init-package-json
# git
git add .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment