Skip to content

Instantly share code, notes, and snippets.

@kasir-barati
Last active September 20, 2022 10:54
Show Gist options
  • Save kasir-barati/83fc3e23326d1cb1dc93ac790595286d to your computer and use it in GitHub Desktop.
Save kasir-barati/83fc3e23326d1cb1dc93ac790595286d to your computer and use it in GitHub Desktop.
#!/bin/bash
pnpm create next-app "$@"
cd "$1"
pnpm i
# Add prettier and its script
pnpm add -D prettier
wget https://gist.githubusercontent.com/kasir-barati/2bcdeea964f88712eca171adb3fbd979/raw/.prettierrc
wget https://gist.githubusercontent.com/kasir-barati/8b32cf62e69e6f87a6bed899eefe1cb5/raw/.prettierignore
node -e "const { readFileSync, writeFileSync } = require('fs'); const packageJson = JSON.parse(readFileSync('package.json', 'utf-8')); packageJson.scripts = { ...packageJson.scripts, \"format\": \"prettier -w . -u\" }; writeFileSync('package.json', JSON.stringify(packageJson))"
# Add License
wget https://gist.githubusercontent.com/kasir-barati/7574fdf252e2648ebeb119264bcd442d/raw/LICENCE
node -e "const { readFileSync, writeFileSync } = require('fs'); const packageJson = JSON.parse(readFileSync('package.json', 'utf-8')); packageJson.license = 'GPL-3.0'; writeFileSync('package.json', JSON.stringify(packageJson))"
# Later works
pnpm format
git init
git add .
git commit -m "cleanup: prettified"
git branch -m main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment