Skip to content

Commit

Permalink
fix: make release-artifact-cleanup executable (#15225)
Browse files Browse the repository at this point in the history
* fix: make release-artifact-cleanup executable

* fix misc issues in cleanup script
  • Loading branch information
ckerr authored and codebytere committed Oct 19, 2018
1 parent 8bc0c34 commit 363712d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions script/release-artifact-cleanup.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if (!process.env.CI) require('dotenv-safe').load()
require('colors')
const args = require('minimist')(process.argv.slice(2), {
boolean: ['tag']
string: ['tag']
})
const { execSync } = require('child_process')
const { GitProcess } = require('dugite')
Expand All @@ -20,7 +20,7 @@ github.authenticate({
})

function getLastBumpCommit (tag) {
const data = execSync(`git log -n1 --grep "Bump ${tag}" --format="format:{hash: %H, message: '%s'}"`)
const data = execSync(`git log -n1 --grep "Bump ${tag}" --format='format:{"hash": "%H", "message": "%s"}'`).toString()
return JSON.parse(data)
}

Expand Down Expand Up @@ -90,9 +90,9 @@ async function deleteTag (tag, targetRepo) {

async function cleanReleaseArtifacts () {
const tag = args.tag
const lastBumpCommit = getLastBumpCommit().message
const isNightly = args.tag.includes('nightly')

if (lastBumpCommit.indexOf('nightly' > 0)) {
if (isNightly) {
await deleteDraft(tag, 'nightlies')
await deleteTag(tag, 'nightlies')
} else {
Expand Down

0 comments on commit 363712d

Please sign in to comment.