1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 01:34:57 +01:00
market/scripts/write-repo-metadata.js

26 lines
691 B
JavaScript
Raw Normal View History

#!/usr/bin/env node
'use strict'
const execSync = require('child_process').execSync
//
// VERCEL_GITHUB_COMMIT_REF & VERCEL_GITHUB_COMMIT_SHA need to be added with empty
// values in Vercel environment variables, making them available to builds.
// https://vercel.com/docs/build-step#system-environment-variables
//
process.stdout.write(
JSON.stringify(
{
version: require('../package.json').version,
2020-11-12 15:32:19 +01:00
branch:
process.env.VERCEL_GITHUB_COMMIT_REF || process.env.BRANCH || 'dev',
commit:
process.env.VERCEL_GITHUB_COMMIT_SHA ||
2020-11-12 15:32:19 +01:00
process.env.COMMIT_REF ||
execSync(`git rev-parse HEAD`).toString().trim()
},
null,
' '
)
)