-
Notifications
You must be signed in to change notification settings - Fork 0
/
tag.ts
23 lines (20 loc) · 765 Bytes
/
tag.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { assert } from 'https://deno.land/std@0.51.0/testing/asserts.ts'
import { resolve } from 'https://deno.land/std@0.51.0/path/mod.ts'
import { readJsonSync } from 'https://deno.land/std@0.51.0/fs/mod.ts'
import { dirname } from 'https://deno.land/x/dirname/mod.ts'
import { pipe } from 'https://deno.land/x/compose@1.3.2/index.js'
const pkgJson: any = pipe(
import.meta,
dirname,
x => resolve(x, 'package.json'),
readJsonSync,
)
assert(typeof pkgJson === 'object', 'package.json must be an object')
assert(pkgJson, 'package.json must not be null')
assert(typeof pkgJson.version === 'string', 'package.json#version must be a string')
Deno.run({
cmd: ['git', 'tag', pkgJson.version],
stdout: 'inherit',
stderr: 'inherit',
stdin: 'inherit'
})