Skip to content

Commit

Permalink
增加-y
Browse files Browse the repository at this point in the history
  • Loading branch information
ikrong committed Jul 5, 2024
1 parent bee189a commit 527ae85
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ gh auth login
./copy.sh nginx:1.14 ikrong/nginx:1.14 --pull
```
10. 脚本默认会有确认提示,使用参数 -y 可以跳过确认执行
```shell
./copy.sh nginx:1.14 ikrong/nginx:1.14 -y
./sync.sh nginx ikrong -y
```
## 镜像同步之后如何使用
当使用上面办法将镜像同步到阿里云容器镜像仓库后,就可以直接使用阿里云容器镜像仓库的镜像了。
Expand Down
11 changes: 10 additions & 1 deletion exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ WORKFLOW=
BRANCH="main"
INPUTS=
PULL=
CONFIRM=

# 你可以在这里修改执行的默认值,请保证顺序一致
INPUT_CONFIGS=(docker.io registry.cn-beijing.aliyuncs.com)
Expand Down Expand Up @@ -327,7 +328,12 @@ function trigger() {
echo "$(g ${inputs[$i]})"
}
fi
read -p "Confirm? [Y/n] "
local REPLY
if [ "$CONFIRM" = "true" ]; then
REPLY="y"
else
read -p "Confirm? [Y/n] "
fi
if [[ $REPLY =~ ^[Yy]$ ]] || [ -z $REPLY ]; then
echo "gh api \
--method POST \
Expand Down Expand Up @@ -531,6 +537,9 @@ while [ $# -gt 0 ]; do
--pull)
PULL="true"
;;
-y | --y | --yes)
CONFIRM="true"
;;
trigger)
CMD="trigger"
;;
Expand Down

0 comments on commit 527ae85

Please sign in to comment.