Skip to content

Commit

Permalink
Create versioned output
Browse files Browse the repository at this point in the history
  • Loading branch information
antriver committed Sep 6, 2022
1 parent 09639e4 commit 63bd9c2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"package": "./node_modules/.bin/pkg node_modules/.bin/lessc -t node14-linux -o bin/lessc"
"package": "./scripts/build.sh"
},
"author": "",
"license": "ISC",
Expand Down
16 changes: 16 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Delete existing builds
rm -rf ./bin

# Generate bin/lessc
./node_modules/.bin/pkg node_modules/.bin/lessc -t node14-linux -o bin/lessc
echo Generated bin/lessc

# Get the version number
VERSION=`./bin/lessc --version | sed -ne 's/[^0-9]*\(\([0-9]\.\)\{0,4\}[0-9][^.]\).*/\1/p'`

# Create a versioned file

cp bin/lessc bin/lessc-$VERSION
echo Generated bin/lessc-$VERSION

0 comments on commit 63bd9c2

Please sign in to comment.