Skip to content

Commit

Permalink
Use temp directory to write intermediate file
Browse files Browse the repository at this point in the history
as writing to the current folder might have permission issues
  • Loading branch information
kabaros committed Jun 3, 2020
1 parent 6ce0a90 commit 37c4fcc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/validate-all-releases/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const shell = require('shelljs')
const extractReleases = require('../utils/plugins/extractAllReleasesFromXml')
const { writeFile } = require('../utils/files')
const { info, error } = require('../utils/log')
const execa = require('execa')

/**
* Entry point for validate-all-releases command
Expand All @@ -14,11 +15,12 @@ module.exports = async args => {
const releases = await extractReleases(inputFilePath)

// Write releases data in a CSV file to be consumed by next bash script
const extractedDataFile = `${__dirname}/${Date.now()}.temp`
let packagesWithSums = ''
releases.forEach(({ expectedMd5Sum, url }) => {
packagesWithSums += expectedMd5Sum + ',' + url + '\n'
})

const { stdout: extractedDataFile } = await execa('mktemp', `${Date.now()}XXXXXXXX`)
await writeFile(extractedDataFile, packagesWithSums)

// use batch script to validate the MD5 checksum for all releases
Expand Down

0 comments on commit 37c4fcc

Please sign in to comment.