Skip to content

Commit

Permalink
add scripts folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-GrunbergerCA committed Sep 19, 2021
1 parent 00e7d24 commit c011ff1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/export.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
python-version: 3.8 #install the python needed
- name: execute py script # run the run.py to get the latest data
run: |
python export.py
python ./scripts/export.py
- name: Upload Release Asset
id: upload-release-asset
Expand Down
File renamed without changes.
19 changes: 19 additions & 0 deletions scripts/generate_id.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh


# Generates new ID for controls. Run it when adding a new control and set the ouput as the 'id' field


# Get current highest id from all controls
HIGHEST_ID=$(grep \"id\": ../controls/*.json -h | cut -d "-" -f 2 | sort | tail -n1 | sed 's/"//g;s/0//g')

NEW_ID=$(echo $(($HIGHEST_ID + 1)))


[ $NEW_ID -lt 10 ] && NEW_ID="0$NEW_ID"

[ $NEW_ID -lt 100 ] && NEW_ID="0$NEW_ID"

[ $NEW_ID -lt 1000 ] && NEW_ID="0$NEW_ID"

echo "C-$NEW_ID"

0 comments on commit c011ff1

Please sign in to comment.