Skip to content

Commit

Permalink
release script src
Browse files Browse the repository at this point in the history
  • Loading branch information
osdiab committed Aug 8, 2020
1 parent b7bea8f commit 3b87033
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/release.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { run } from './run'
import * as child_process from 'child_process'
import { left, right } from 'fp-ts/Either'
import * as TE from 'fp-ts/TaskEither'

const DIST = 'dist'

const exec = (cmd: string, args?: child_process.ExecOptions): TE.TaskEither<Error, void> => () =>
new Promise((resolve) => {
child_process.exec(cmd, args, (err) => {
if (err !== null) {
return resolve(left(err))
}

return resolve(right(undefined))
})
})

export const main = exec('npm publish', {
cwd: DIST
})

run(main)

0 comments on commit 3b87033

Please sign in to comment.