Skip to content

Commit 2bacf92

Browse files
committed
Add the version from outside of the package.json template
1 parent 3315b7b commit 2bacf92

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v0.7.1

bin/build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
puts "~~> Building package.json..."
44

55
require 'json'
6-
package = JSON.parse File.read("#{__dir__}/../package.src.json")
6+
7+
package = {
8+
version: File.read("#{__dir__}/../VERSION").strip.delete_prefix('v')
9+
}
10+
package.merge! JSON.parse File.read("#{__dir__}/../package.src.json")
11+
712

813
class Hash
914
def dig!(*keys)

bin/release

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
#!/usr/bin/env bash
22

33
set -e
4+
5+
version="$1"
6+
if [ -z "$version" ]; then
7+
echo "Usage: bin/release <version>"
8+
echo "Example: bin/release v1.2.3"
9+
exit 1
10+
fi
11+
12+
echo "$version" > VERSION
13+
414
yarn install
515
bin/build
16+
git add VERSION package.json
17+
git commit -m "Release $version"
618
git diff --exit-code
719
git tag -m "" "v$(cat package.json | ruby -rjson -e 'puts JSON[$<.read][%{version}]')"
820
git push --tags

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"version": "0.7.2",
23
"name": "vscode-textmate",
34
"displayName": "TextMate (keymap and features, 🚧 work in progress! 🚧)",
45
"description": "TextMate features and keybindings for Visual Studio Code",
@@ -8,7 +9,6 @@
89
},
910
"icon": "icon.png",
1011
"publisher": "elia",
11-
"version": "0.7.1",
1212
"engines": {
1313
"vscode": "^1.77.0"
1414
},

package.src.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
},
99
"icon": "icon.png",
1010
"publisher": "elia",
11-
"version": "0.7.1",
1211
"engines": {
1312
"vscode": "^1.77.0"
1413
},

0 commit comments

Comments
 (0)