FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
tauri-tutorial/scripts/release.mjs at main · virtoolswebplayer/tauri-tutorial · GitHub
virtoolswebplayer
/
tauri-tutorial
Public
forked from
lencx/tauri-tutorial
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
tauri-tutorial
/
scripts
/
release.mjs
Copy path
More file actions
More file actions
Latest commit
History
History
History
44 lines (35 loc) · 1.14 KB
Breadcrumbs
tauri-tutorial
/
scripts
/
release.mjs
Copy path
File metadata and controls
44 lines (35 loc) · 1.14 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import
{
createRequire
}
from
'module'
;
import
{
execSync
}
from
'child_process'
;
import
fs
from
'fs'
;
import
updatelog
from
'./updatelog.mjs'
;
const
require
=
createRequire
(
import
.
meta
.
url
)
;
async
function
release
(
)
{
const
flag
=
process
.
argv
[
2
]
??
'patch'
;
const
packageJson
=
require
(
'../package.json'
)
;
let
[
a
,
b
,
c
]
=
packageJson
.
version
.
split
(
'.'
)
.
map
(
Number
)
;
if
(
flag
===
'major'
)
{
a
+=
1
;
b
=
0
;
c
=
0
;
}
else
if
(
flag
===
'minor'
)
{
b
+=
1
;
c
=
0
;
}
else
if
(
flag
===
'patch'
)
{
c
+=
1
;
}
else
{
console
.
log
(
`Invalid flag "
${
flag
}
"`
)
;
process
.
exit
(
1
)
;
}
const
nextVersion
=
`
${
a
}
.
${
b
}
.
${
c
}
`
;
packageJson
.
version
=
nextVersion
;
const
nextTag
=
`v
${
nextVersion
}
`
;
await
updatelog
(
nextTag
,
'release'
)
;
fs
.
writeFileSync
(
'./package.json'
,
JSON
.
stringify
(
packageJson
,
null
,
2
)
)
;
execSync
(
'git add ./package.json ./UPDATE_LOG.md'
)
;
execSync
(
`git commit -m "v
${
nextVersion
}
"`
)
;
execSync
(
`git tag -a v
${
nextVersion
}
-m "v
${
nextVersion
}
"`
)
;
execSync
(
`git push`
)
;
execSync
(
`git push origin v
${
nextVersion
}
`
)
;
console
.
log
(
`Publish Successfully...`
)
;
}
release
(
)
.
catch
(
console
.
error
)
;
Back
|
FazBrowse Home
|
New Git URL