diff --git a/Tasks/qlrepo/extra.sh b/Tasks/qlrepo/extra.sh index 546d413..cbb171b 100644 --- a/Tasks/qlrepo/extra.sh +++ b/Tasks/qlrepo/extra.sh @@ -107,74 +107,3 @@ ql repo https://github.com/Aaron-lv/sync.git "jd_cfd" "" "" "jd_scripts" ## 口袋书店 ## ql raw https://raw.githubusercontent.com/Wenmoux/scripts/wen/jd/chinnkarahoi_jd_bookshop.js ql repo https://github.com/Wenmoux/scripts.git "chinnkarahoi_jd_bookshop" "" "" "wen" - - -# 依赖 -package_name="canvas png-js date-fns axios crypto-js ts-md5 tslib @types/node dotenv" - -install_dependencies_normal(){ - for i in $@; do - case $i in - canvas) - if [[ "$(npm ls $i)" =~ (empty) ]]; then - apk add --no-cache build-base g++ cairo-dev pango-dev giflib-dev && npm install $i --build-from-source - fi - ;; - *) - if [[ "$(npm ls $i -g)" =~ (empty) ]]; then - if [[ "$(npm ls $i)" =~ $i ]]; then - npm uninstall $i - fi - npm i $i -g - fi - ;; - esac - done -} - -install_dependencies_force(){ - for i in $@; do - if [[ "$(npm ls $i)" =~ $i ]]; then - npm uninstall $i - rm -rf /ql/scripts/node_modules/$i - rm -rf /ql/scripts/node_modules/lodash - elif [[ "$(npm ls $i -g)" =~ $i ]]; then - npm uninstall -g $i - rm -rf /usr/local/lib/node_modules/$i - rm -rf /usr/local/lib/node_modules/lodash - fi - case $i in - canvas) - if [[ "$(npm ls $i)" =~ (empty) ]]; then - apk add --no-cache build-base g++ cairo-dev pango-dev giflib-dev && npm install $i --build-from-source - fi - ;; - *) - if [[ "$(npm ls $i -g)" =~ (empty) ]]; then - if [[ "$(npm ls $i)" =~ $i ]]; then - npm uninstall $i - fi - npm i $i -g - fi - ;; - esac - done -} - -install_dependencies_all(){ - install_dependencies_normal $package_name - for i in $package_name; do - if [[ "$(npm ls $i -g)" =~ (empty) ]] && [[ "$(npm ls $i)" =~ (empty) ]]; then - install_dependencies_force $i - fi - done -} - -install_dependencies_all & - -:<