Skip to content

Commit

Permalink
Added a script to help with version bumping
Browse files Browse the repository at this point in the history
  • Loading branch information
kieraneglin committed Jul 18, 2024
1 parent dbc25e5 commit 47596d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ defmodule Pinchflat.MixProject do
"ecto.rollback": [
"ecto.rollback",
~s(cmd [ -z "$MIX_ENV" ] && yarn run create-erd || echo "No ERD generated")
]
],
"version.bump": "cmd ./tooling/version_bump.sh"
]
end
end
14 changes: 14 additions & 0 deletions tooling/version_bump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Get the current date in the format YYYY.MM.DD (stripping leading zeros)
DATE=$(date +"%Y.%-m.%-d")

# Get the current version from mix.exs
VERSION=$(grep "version: " mix.exs | cut -d '"' -f2)

echo "Bumping version from $VERSION to $DATE"
# Replace the version in mix.exs with the new version
sed -i "s/version: \"$VERSION\"/version: \"$DATE\"/g" mix.exs

# Run checks to ensure it's a valid mix.exs file
mix check

0 comments on commit 47596d5

Please sign in to comment.