Skip to content

Commit

Permalink
feat: adjust prepare to s3 script
Browse files Browse the repository at this point in the history
  • Loading branch information
lukascivil committed Dec 27, 2023
1 parent 557486d commit 14af68e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/json-difference/prepare-to-s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
import * as path from 'path'
import fs from 'fs'

const version: string = JSON.parse(fs.readFileSync('libs/json-difference/dist.browser/package.json', 'utf-8')).version
const currentDir = path.resolve(path.join(__dirname))
const version: string = JSON.parse(fs.readFileSync(`${currentDir}/dist.browser/package.json`, 'utf-8')).version
const tempDir = path.resolve(path.join(__dirname, `dist.browser-temp`))

if (!fs.existsSync(tempDir)) {
fs.mkdirSync(tempDir)
}

// Copy dist.browser -> dist.browser-temp
fs.cpSync(`${currentDir}/dist.browser`, tempDir, { recursive: true })

// Clear dist.browser
fs.rmSync(`${currentDir}/dist.browser`, { recursive: true, force: true })

// Copy dist.browser-temp -> dist.browser-s3
fs.cpSync(tempDir, `${currentDir}/dist.browser-s3/${version}`, { recursive: true })

// Clear dist.browser-temp
fs.rmSync(tempDir, { recursive: true, force: true })

0 comments on commit 14af68e

Please sign in to comment.