-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New version file * script refactoring * New command * clean up * new env var * Fixing issues --------- Co-authored-by: Maksym Bilan <>
- Loading branch information
1 parent
75d59ee
commit daa85dd
Showing
10 changed files
with
42 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package bot | ||
|
||
import "os" | ||
|
||
func handleVersion(session *Session) { | ||
versionStr := "Version: " + os.Getenv("APP_VERSION") | ||
setOutputText(versionStr, session) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# File containing the version constant (relative to the script location) | ||
VERSION_FILE="./version.go" | ||
get_version() { | ||
local script_dir version_file | ||
script_dir=$(dirname "$0") | ||
version_file="$script_dir/../VERSION" | ||
|
||
# Pattern to match the version line | ||
VERSION_PATTERN='const AppVersion = "' | ||
if [[ ! -f "$version_file" ]]; then | ||
echo "Error: $version_file not found." >&2 | ||
exit 1 | ||
fi | ||
|
||
# Check if version.go exists | ||
if [[ ! -f "$VERSION_FILE" ]]; then | ||
echo "Error: $VERSION_FILE not found." | ||
exit 1 | ||
fi | ||
cat "$version_file" | ||
} | ||
|
||
# Extract the current version | ||
CURRENT_VERSION=$(grep "$VERSION_PATTERN" "$VERSION_FILE" | sed -E 's/.*"([0-9]+\.[0-9]+\.[0-9]+)".*/\1/') | ||
|
||
if [[ -z "$CURRENT_VERSION" ]]; then | ||
echo "Error: Could not find the current version in $VERSION_FILE" | ||
exit 1 | ||
fi | ||
|
||
# Output the current version | ||
echo "$CURRENT_VERSION" | ||
CURRENT_VERSION=$(get_version) | ||
echo "The current version is: $CURRENT_VERSION" |