mirror of
https://github.com/zkitter/configs.git
synced 2026-01-08 21:17:59 -05:00
Ask to overwrite config files when installing
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "sh postinstall.sh"
|
||||
"postinstall": "bash postinstall.sh"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# see sharing eslint config & npm scoped modules https://eslint.org/docs/latest/developer-guide/shareable-configs#npm-scoped-modules
|
||||
echo "extends: ['@r1oga']" > "$INIT_CWD/.eslintrc.yaml"
|
||||
cp .eslintignore "$INIT_CWD/.eslintignore"
|
||||
if [[ ! -f "$INIT_CWD/.eslintrc.yaml" ]];then
|
||||
echo "extends: ['@r1oga']" > "$INIT_CWD/.eslintrc.yaml"
|
||||
else
|
||||
read -p "overwrite .eslintrc.yaml?(Yn) " overwrite
|
||||
if [[ -z "$overwrite" || "$overwrite" -eq "Y" || "$overwrite" -eq "y" ]];then
|
||||
echo "extends: ['@r1oga']" > "$INIT_CWD/.eslintrc.yaml"
|
||||
fi
|
||||
fi
|
||||
|
||||
cp -i .eslintignore "$INIT_CWD/.eslintignore"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "js-yaml .prettierrc.yaml > .prettierrc.json",
|
||||
"postinstall": "sh postinstall.sh"
|
||||
"postinstall": "bash postinstall.sh"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"prettier": "^2.8.1"
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "'@r1oga/prettier-config'" > "$INIT_CWD/.prettierrc.yaml"
|
||||
cp .prettierignore "$INIT_CWD/.prettierignore"
|
||||
if [[ ! -f "$INIT_CWD/.prettierrc.yaml" ]];then
|
||||
echo "'@r1oga/prettier-config'" > "$INIT_CWD/.prettierrc.yaml"
|
||||
else
|
||||
# shellcheck disable=SC2162
|
||||
read -p "overwrite .prettierrc.yaml?(Yn) " overwrite
|
||||
if [[ -z "$overwrite" || "$overwrite" -eq "Y" || "$overwrite" -eq "y" ]];then
|
||||
echo "'@r1oga/prettier-config'" > "$INIT_CWD/.prettierrc.yaml"
|
||||
fi
|
||||
fi
|
||||
|
||||
cp -i .prettierignore "$INIT_CWD/.prettierignore"
|
||||
Reference in New Issue
Block a user