几年来的一些琐碎零散笔记,整理一下,清空笔记!
npm 与 node
npm install -g npm
npm install -g npm@5.6.0
npm config set registry https:
npm config set registry https:
npm config get registry
npm uninstall sass-loader
npm install sass-loader@7.1.0
npm --registry http:
node -v
npm cache clean -f
npm install -g n
n stable
n lts
n latest
n 10.14.2
yarn
npm install
yarn
yarn init
yarn add [package]
yarn add [package]@[version]
yarn upgrade [package]
yarn upgrade [package]@[version]
yarn remove [package]
yarn 或者 yarn install
Chrome
open -n /Applications/Google\ Chrome.app/ --args --disable-web-security --user-data-dir=/Users/apple/Documents/MyChromeDevUserData
git clone <https:
cd vue-devtools
npm i
npm run build
打开Chrome>更多工具>扩展程序>打开开发者模式
点击加载已解压的扩展程序 > 找到刚才生成的chrome文件夹 > 选择 vue-devtools > shells > chrome 放入
nginx
sudo nginx
sudo nginx -s reload
sudo nginx -s quit
sudo nginx -s
stop killall nginx
sudo lsof -i tcp:8088(端口)
kill 1882(PID)
常用文件地址
/etc/hosts
/usr/local/etc/nginx/
/Users/myMac/.bash_profile
/usr/bin/
~/.ssh/
yml
build:
script:
- git clone http://gitlab-ci-token:${CI_JOB_TOKEN}@git.domain.com/code.git
- code_branch=`cat version.txt`
- echo "当前分支是:${code_branch}"
- cd code
- git checkout -b origin/${code_branch}
- git branch -a
- cd ../
- chmod +x run.sh
- bash run.sh code
- chmod +x build.sh
- bash build.sh
cache:
paths:
- node_modules
allow_failure: false
only:
- tags
except:
- branches
tags:
- node14
shell
// 运行
sh my.sh myPath
:<<EOF
多行注释
EOF
path=$1
mkdir -p ./pkg/${path}/p1
cd ./whole/p2
zip -r -q ../../pkg/${path}/p1
code_path="../code"
for element in `ls $code_path`
do
dir_or_file=$code_path"/"$element
if [ -d $dir_or_file ]
then
if [ ${dir_or_file##*/} = "static" ]
then
cp -r ./src/static/common $code_path/static
rm -r ./src/static/common
else
cp -r ./src/${dir_or_file##*/} $code_path
rm -r ./src/${dir_or_file##*/}
fi
else
if [[ ${dir_or_file##*/} = ".gitignore" || ${dir_or_file##*/} = ".git" ]]
then
continue
else
cp -r ./src/${dir_or_file##*/} $code_path
rm -r ./src/${dir_or_file##*/}
fi
fi
done
echo "已完成分离"
tag=$CI_COMMIT_TAG
npm config set registry https://registry.npm.taobao.org
npm i
if [[ "$tag" == *-baidu-* ]];then
npm i swan-toolkit
fi
if [[ "$tag" == *-bj ]];then
npm run change-bj
elif [[ "$tag" == *-sh ]];then
npm run change-sh
fi;
if [[ "$tag" == *-weixin-* ]];then
npm run build:mp-weixin
elif [[ "$tag" == *-baidu-* ]];then
npm run build:mp-baidu;
fi