Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Republish Templates #280

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
tool to update all patch versions
joshspicer committed Aug 26, 2024
commit 1863289b6f31e49a94e4c8f85ad108e665d977a0
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"useTabs": false,
"tabWidth": 4,
"printWidth": 30,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"semi": true,
"arrowParens": "always"
}
18 changes: 18 additions & 0 deletions build/increment-patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Increments the patch version (x.y.z -> x.y.<z+1>) of all devcontainer-template.json files in the src/ directory.
# Expects a ''.prettierrc' config file in the root

cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit 1

find src/ -name 'devcontainer-template.json' -exec bash -c '
for file; do
version=$(jq -r ".version" "$file")
IFS="." read -r major minor patch <<< "$version"
new_patch=$((patch + 1))
new_version="$major.$minor.$new_patch"
jq ".version = \"$new_version\"" "$file" > tmp.$$.json && mv tmp.$$.json "$file"
done
' bash {} +

npx prettier --write src/**/devcontainer-template.json