Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritysdx committed Jul 1, 2024
1 parent 6d1f806 commit 956f659
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions goecs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,12 @@ goecs_check() {
if [ $? -eq 0 ]; then
extracted_version=$(echo "${version_output//v/}")
if [ -n "$extracted_version" ]; then
current_version=$(echo "$extracted_version" | cut -c 2-)
ecs_version=$ECS_VERSION
if [[ "$(echo -e "$current_version\n$ecs_version" | sort -V | tail -n 1)" == "$current_version" ]]; then
echo "goecs version ($current_version) is latest, no need to upgrade."
if [[ "$(echo -e "$extracted_version\n$ecs_version" | sort -V | tail -n 1)" == "$extracted_version" ]]; then
echo "goecs version ($extracted_version) is latest, no need to upgrade."
return
else
echo "goecs version ($current_version) < $ecs_version, need to upgrade, 5 seconds later will start to upgrade"
echo "goecs version ($extracted_version) < $ecs_version, need to upgrade, 5 seconds later will start to upgrade"
rm -rf /usr/bin/goecs
rm -rf goecs
fi
Expand Down
12 changes: 6 additions & 6 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,16 @@ func ProcessAndUpload(output string, filePath string, enableUplaod bool) {
}
if enableUplaod {
// 获取文件的绝对路径
absPath, err := filepath.Abs(filePath)
if err != nil {
fmt.Println("Failed to get absolute file path:", err)
absPath, err2 := filepath.Abs(filePath)
if err2 != nil {
fmt.Println("Failed to get absolute file path:", err2)
return
}
// 上传文件并生成短链接
shorturl, err := UploadText(absPath)
if err != nil {
shorturl, err3 := UploadText(absPath)
if err3 != nil {
fmt.Println("Upload failed, cannot generate short URL.")
fmt.Println(err.Error())
fmt.Println(err3.Error())
return
}
fmt.Println("Upload successful, short URL:", shorturl)
Expand Down

0 comments on commit 956f659

Please sign in to comment.