From 80e944ae7ef2ce0ae6dd82c8619d01200b60c589 Mon Sep 17 00:00:00 2001 From: undefined Date: Sat, 26 Nov 2022 20:45:01 +0800 Subject: [PATCH] workspace: add warning for uninstall (close #465) --- install/uninstall.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/install/uninstall.sh b/install/uninstall.sh index cce33597..629732a5 100644 --- a/install/uninstall.sh +++ b/install/uninstall.sh @@ -1,8 +1,35 @@ #!/bin/bash +clear +echo " +Warning: + This will also delete all process managed by pm2, + and all related data on your machine. + Don't blame me if someone sues you for this, your cat dies etc. + You are warned. +警告: + 此脚本会删除所有 pm2 托管的进程,并删除所有相关数据。 + +Type 'Yes, do as I say!' (without quotes) below to continue: +输入 'Yes, do as I say!' (不含引号) 继续:" +read -p "> " confirm; +if [ "$confirm" != "Yes, do as I say!" ];then + echo "Aborted." + exit; +fi + +echo "The script will run in 10 seconds. Press Ctrl+C to cancel." +echo "脚本将在 10 秒后执行。按 Ctrl+C 取消。" +sleep 10 pm2 stop all pm2 del all pm2 unstartup + +yarn global remove $(yarn global list | grep info | sed 's/^info "\(.*\)@.*".*$/\1/') rm -rf `yarn global dir` + rm -rf /nix + rm -rf /data +rm -rf ~/.config/hydro +rm -rf ~/.hydro