Skip to content

Commit

Permalink
Reserve Package Name: Allow agave-prefix (solana-labs#1998)
Browse files Browse the repository at this point in the history
Allow agave-prefix
  • Loading branch information
apfitzge authored Jul 8, 2024
1 parent cbc8320 commit f883da7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/reserve-cratesio-package-name.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ USAGE:
FLAGS:
--help Display this help message
--no-solana-prefix Do not require \`solana-\` prefix on PACKAGE_NAME
--no-prefix Do not require \`agave-\` or \`solana-\` prefix on PACKAGE_NAME
--publish Upload the reserved package. Without this flag, a
dry-run is performed
Expand All @@ -26,7 +26,7 @@ ARGS:
EOF
}

require_solana_prefix=true
require_prefix=true
maybe_publish='--dry-run'
positional=()
while [[ -n "$1" ]]; do
Expand All @@ -38,8 +38,8 @@ while [[ -n "$1" ]]; do
display_help
exit 0
;;
--no-solana-prefix)
require_solana_prefix=false
--no-prefix)
require_prefix=false
;;
--publish)
maybe_publish=''
Expand Down Expand Up @@ -89,9 +89,9 @@ if ! [[ "${package_name}" =~ ^[a-zA-Z0-9_-]{1,64} ]]; then
exit 1
fi

if ${require_solana_prefix} && ! [[ "${package_name}" =~ ^solana- ]]; then
if ${require_prefix} && ! [[ "${package_name}" =~ ^(agave|solana)- ]]; then
# shellcheck disable=SC2016 # backticks are not a command here
echo 'error: PACKAGE_NAME MUST start with `solana-`' 1>&2
echo 'error: PACKAGE_NAME MUST start with `agave-` or `solana-`' 1>&2
display_help
exit 1
fi
Expand Down

0 comments on commit f883da7

Please sign in to comment.