#!/bin/bash
echo "create links..."
	# set -x or set -o xtrace expands variables and prints a little + sign before the line.
	# set -v or set -o verbose does not expand the variables before printing
set -v # set verboose mode
# tool/create_links.sh
cd ~/nc
rm ~/nc/bin

cd ~/nc/nc-server/preference
# rm form
# ln -s ../../nc-plugin/preference/form .

cd ~/nc/nc-server
# rm plugin
# ln -s ../nc-plugin/plugin .

rm -rf .vscode
rm .editorconfig
cp ../nc-designer/.editorconfig .
rm .eslintignore
cp ../nc-designer/.eslintignore .
rm .eslintrc.js
cp ../nc-designer/.eslintrc.js .
rm .gitignore
cp ../nc-designer/.gitignore .
rm .markdownlintrc
cp ../nc-designer/.markdownlintrc .
rm .prettierrc.js
rm .prettierrc.json
rm .prettierrc.cjs
cp ../nc-designer/.prettierrc.cjs .

pnpm i
pnpm upgrade --interactive --latest

cd ~/nc/nc-plugin
rm package.json
cp ../nc-server/package.json .

rm -rf .vscode
rm .editorconfig
cp ../nc-designer/.editorconfig .
rm .eslintignore
cp ../nc-designer/.eslintignore .
rm .eslintrc.js
cp ../nc-designer/.eslintrc.js .
rm .gitignore
cp ../nc-designer/.gitignore .
rm .markdownlintrc
cp ../nc-designer/.markdownlintrc .
rm .prettierrc.js
rm .prettierrc.json
rm .prettierrc.cjs
cp ../nc-designer/.prettierrc.cjs .


pnpm i
pnpm upgrade --interactive --latest

read
