Skip to content

Commit d3fee5e

Browse files
committed
Make this an independent repo
1 parent ce2e74e commit d3fee5e

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
.nyc_output
3+
.vscode/
4+
coverage
5+
dist
6+
node_modules

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
"scripts": {
99
"test": "mocha --recursive \"./test/*.js\"",
1010
"lint": "eslint lib test cli.js",
11-
"buildbin": "../scripts/build-fastbin.sh",
12-
"buildpack": "../scripts/build-npmpack.sh",
11+
"buildbin": "./scripts/build-fastbin.sh",
1312
"coverage": "nyc npm test"
1413
},
1514
"keywords": [

scripts/build-fastbin.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
set -eu
3+
4+
version=$(./scripts/getversion.sh)
5+
outdir=./dist
6+
targets=node12-win,node12-macos,node12-linux,node12-alpine
7+
8+
# Generate binaries
9+
pkg . -t ${targets} -o "${outdir}/fast-${version}"
10+
11+
# Generate sha256 hashes
12+
cd "${outdir}"
13+
for bin in $(ls "fast-${version}-"*)
14+
do
15+
sha256sum "${bin}" > "${bin}.sha256"
16+
done

scripts/getversion.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -eu
3+
4+
full_version=$(node -e "console.log(require('./package.json').version)")
5+
version="$(echo $full_version | cut -d - -f 1)"
6+
last_tag="$(git describe --tags --always --abbrev=0)"
7+
num_commits_from_tag=$(git rev-list $last_tag.. --count)
8+
if [[ "$last_tag" == "v${version}"* ]]; then
9+
version="$(echo $last_tag | tail -c +2)"
10+
fi
11+
if [ "$num_commits_from_tag" -ne 0 ]; then
12+
version="$version.dev$num_commits_from_tag"
13+
fi
14+
15+
echo ${version}

0 commit comments

Comments
 (0)