Skip to content

Commit 5b3979f

Browse files
authored
Merge pull request #70 from cloudgraphdev/beta
Beta
2 parents bc0cfc4 + 00181f9 commit 5b3979f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

release/scripts/homebrew.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const DIST_DIR = path.join(CLI_DIR, 'dist')
1717
const PJSON = require(path.join(CLI_DIR, 'package.json'))
1818
const NODE_VERSION = PJSON.oclif.update.node.version
1919
const SHORT_VERSION = PJSON.version
20-
const pathToDist = path.join(DIST_DIR, `cg-v${SHORT_VERSION}`)
2120
async function getText(url) {
2221
return new Promise((resolve, reject) => {
2322
https
@@ -65,7 +64,7 @@ async function calculateSHA256(fileName) {
6564
async function uploadToS3(file) {
6665
console.log(`Uploading ${file} to S3`)
6766
await new Promise((resolve, reject) => {
68-
const pathToFile = path.join(pathToDist, file)
67+
const pathToFile = path.join(DIST_DIR, file)
6968
const fileStream = fs.createReadStream(pathToFile)
7069
fileStream.on('error', err => {
7170
if (err) {
@@ -130,7 +129,7 @@ async function uploadToS3(file) {
130129
}
131130

132131
function getFilesByOS(os) {
133-
const files = fs.readdirSync(pathToDist)
132+
const files = fs.readdirSync(DIST_DIR)
134133
return files.filter(file => file.includes(os) && !file.includes('.xz'))
135134
}
136135

@@ -145,7 +144,7 @@ async function updateCgFormula(brewDir) {
145144
const template = fs.readFileSync(templatePath).toString('utf-8')
146145
const files = getFilesByOS('darwin-x64')
147146
const zipFile = files.find(file => file.includes('tar.gz'))
148-
const pathToFile = path.join(pathToDist, zipFile)
147+
const pathToFile = path.join(DIST_DIR, zipFile)
149148
const sha256 = await calculateSHA256(pathToFile)
150149
const url = `${CLI_ASSETS_URL}/cg-v${SHORT_VERSION}/${zipFile}`
151150

0 commit comments

Comments
 (0)