Skip to content

Commit 4ee3648

Browse files
authored
feat: Update migration script to take input values; rename with a better name. (#1305)
1 parent 3a51874 commit 4ee3648

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
# - Copy the required source files for the sample into the new directory.
77
# These must come from the repo archive you downloaded.
88
# To run this script:
9-
# 1. Fill in the NAME, REGION_TAG, TITLE, and API_LOADER below.
10-
# Get these values from the <sample-name>.json for the sample being migrated.
11-
# 2. cd to the js-api–samples/samples folder on your local computer.
12-
# 3. ./new1.sh
13-
14-
# AUTHOR: Update these values!
15-
NAME="sample-name" # The name of the folder to create (for example "map-simple").
16-
REGION_TAG="maps_sample_name" # The region tag to use (for example "maps_map_simple").
17-
TITLE="A short description." # The title of the example.
9+
# 1. cd to the js-api-samples/samples folder on your local computer.
10+
# 2. ./migrate-sample.sh <NAME> <TITLE>
11+
12+
if [ -z "$1" ] || [ -z "$2" ]; then
13+
echo "Usage: $0 <NAME> <TITLE>"
14+
exit 1
15+
fi
16+
17+
NAME="$1" # The name of the folder to create (for example "map-simple").
18+
TITLE="$2" # The title of the example.
19+
REGION_TAG="maps_${NAME//-/_}" # The region tag to use (for example "maps_map_simple").
1820
API_LOADER="api_loader_dynamic" # The type of loader to use (api_loader_dynamic or api_loader_default).
1921

2022
# Path to the source folder for the repo archive; substitute with your own path.

0 commit comments

Comments
 (0)