Explorar o código

Update .gitignore and modify push script for improved file handling

- Added .DS_Store to .gitignore to prevent macOS system files from being tracked.
- Updated push.sh script to change directory to the script's location before executing the SCP command, ensuring correct file paths during deployment.
tianyun hai 6 meses
pai
achega
83d80178f6
Modificáronse 2 ficheiros con 5 adicións e 1 borrados
  1. 1 0
      .gitignore
  2. 4 1
      simple-demo/push.sh

+ 1 - 0
.gitignore

@@ -2,3 +2,4 @@ node_modules
 package-lock.json
 .idea
 dist
+.DS_Store

+ 4 - 1
simple-demo/push.sh

@@ -1,8 +1,11 @@
+# 定位到脚本所在目录并切换到上级目录
+cd "$(dirname "$0")"
+
 remote=root@www.tianyunperfect.cn
 
 
 # 在本地执行的代码,比如上传文件到服务器 scp 本地文件 user@ip:远程目录
 #scp -i ~/.ssh/tianyun.pem -r ../simple-demo/* ${remote}:/www/wwwroot/web.tianyunperfect.cn/simple
-scp -i ~/.ssh/tianyun.pem -r ../simple-demo/memos.html ${remote}:/www/wwwroot/web.tianyunperfect.cn/simple
+scp -r memos.html ${remote}:/www/wwwroot/web.tianyunperfect.cn/simple
 
 echo ok