Skip to content

Commit ca246d8

Browse files
committed
cli: sandbox/add - add from registry
1 parent 8c283c1 commit ca246d8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

codapi-cli

+6
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ do_sandbox_add() {
5757
exit 1
5858
fi
5959

60+
# 0. Check if the path a package name.
61+
if [[ "$path" =~ ^[a-zA-Z0-9_-]*$ ]]; then
62+
# This is a package name, so we need to download it from the registry.
63+
path="https://github.com/nalgeon/sandboxes/releases/download/latest/$path.tar.gz"
64+
fi
65+
6066
# 1. Set the name of the sandbox.
6167
local filename
6268
filename=$(basename "$path")

0 commit comments

Comments
 (0)