Skip to content

Commit d8bca44

Browse files
committed
Update update_version.sh
1 parent 5568507 commit d8bca44

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

docs.kosli.com/content/getting_started/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ kosli version
100100
```
101101
The expected output should be similar to this:
102102
```plaintext {.light-console}
103-
version.BuildInfo{Version:"2.11.4", GitCommit:"Homebrew", GitTreeState:"clean", GoVersion:"go1.23.4"}
103+
version.BuildInfo{Version:"%%VERSION%%", GitCommit:"Homebrew", GitTreeState:"clean", GoVersion:"go1.23.4"}
104104
```
105105

106106
## Using the CLI

docs.kosli.com/netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
HUGO_ENABLEGITINFO = "true"
88

99
[context.staging-docs]
10-
command = "git fetch --tags && bash update_version.sh && HUGO_BASEURL=$STAGING_URL hugo"
10+
command = "git fetch --tags -f && bash update_version.sh && HUGO_BASEURL=$STAGING_URL hugo"
1111

1212
[dev]
1313
command = "hugo -b http://127.0.0.1:8888/ -w --buildDrafts -F "

docs.kosli.com/update_version.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
#!/bin/bash
22

3-
if [[ "$OSTYPE" == "darwin"* ]]; then
4-
SED_CMD="sed -i ''"
5-
else
6-
SED_CMD="sed -i"
7-
fi
8-
93
VERSION=$(git describe --tags --abbrev=0 | cut -c2-)
104
TARGET_DIR="content"
115

126
find "$TARGET_DIR" -type f | while read -r file; do
13-
$SED_CMD "s/%%VERSION%%/$VERSION/g" "$file"
7+
if [[ "$OSTYPE" == "darwin"* ]]; then
8+
sed -i '' "s/%%VERSION%%/$VERSION/g" "$file"
9+
else
10+
sed -i "s/%%VERSION%%/$VERSION/g" "$file"
11+
fi
1412
done
1513

16-
echo "Version replaced in content."
14+
15+
echo "Version replaced to $VERSION in content."

0 commit comments

Comments
 (0)