1 | #!/bin/bash
|
2 | set -euo pipefail
|
3 |
|
4 | commit=${CODEBUILD_RESOLVED_SOURCE_VERSION:-}
|
5 |
|
6 |
|
7 | if [ -z "${commit}" ]; then
|
8 | commit="$(git rev-parse --verify HEAD)"
|
9 | suffix="@dev"
|
10 | fi
|
11 |
|
12 | VERSION=$(node -p "require('./package.json').version.replace(/\\+[0-9a-f]+\$/, '')")
|
13 |
|
14 | cat > lib/version.ts <<HERE
|
15 | // Generated at $(date -u +"%Y-%m-%dT%H:%M:%SZ") by generate.sh
|
16 |
|
17 | /** The short version number for this jsii-pacmak release (e.g: \`X.Y.Z\`) */
|
18 | // eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
19 | export const VERSION: string = '${VERSION}';
|
20 |
|
21 | /** The qualified version number for this jsii-pacmak release (e.g: \`X.Y.Z (build
|
22 | export const VERSION_DESC = '${VERSION} (build ${commit:0:7}${suffix:-})';
|
23 | HERE
|