Skip to content

Commit 52afa66

Browse files
New project json (#12)
* fix jq * try jq again * try new approach * cleanup * SC2002 (style): Useless cat. * remove projects json, add info to _project_.json in project dir * reate dir if it doesnt exist
1 parent 2f62ad1 commit 52afa66

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/commands/copy_docs_to_target.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ steps:
1111
name: "Move static content to appropriate folder"
1212
command: <<include(scripts/move_static_content.sh)>>
1313
- run:
14-
name: "Create _category_.json"
14+
name: "Create _project_.json"
1515
command: <<include(scripts/create_project_json.sh)>>
1616

src/scripts/create_project_json.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
# Assumes LABEL, DESCRIPTION, TARGET_REPO_DIRECTORY, and PROJECT_NAME are environment variables
44

55
CreateProjectJSONFromTemplate() {
6+
# Ensure the target directory exists
7+
mkdir -p "$TARGET_REPO_DIRECTORY/docs/$PROJECT_NAME/"
8+
69
# Inlined template with placeholders
710
# shellcheck disable=SC2016
8-
TEMPLATE='{"label": "${LABEL}","description": "${DESCRIPTION}", projectName:"${PROJECT_NAME}"}'
11+
TEMPLATE='{"label": "${LABEL}","description": "${DESCRIPTION}", "projectName":"${PROJECT_NAME}"}'
912

10-
# Substitute the variables in the template and write to target location
13+
# Substitute the variables in the template and write to target location
1114
echo "$TEMPLATE" | sed \
1215
-e "s/\${LABEL}/$LABEL/" \
1316
-e "s/\${DESCRIPTION}/$DESCRIPTION/" \

0 commit comments

Comments
 (0)