File tree 1 file changed +27
-18
lines changed
1 file changed +27
-18
lines changed Original file line number Diff line number Diff line change @@ -6,31 +6,40 @@ publish_npm() {
6
6
yarn workspaces foreach -A --no-private npm publish --tolerate-republish --access public
7
7
}
8
8
9
- clean_root () {
10
- pkg=" $1 "
11
- exclude_regex=" \./\.git\|\./packages\|\./\|\./packages/$pkg \|\./LICENSE"
12
- find . -maxdepth 1 -not -regex " $exclude_regex " -exec rm -rf {} +
9
+ clean () {
10
+ pkg=" $1 "
11
+ exclude_regex=" \./\.git\|\./packages\|\./\|\./packages/$pkg \|\./LICENSE"
12
+ find . -maxdepth 1 -not -regex " $exclude_regex " -exec rm -rf {} +
13
13
}
14
14
15
15
publish_forge_pkg () {
16
- pkg=" $1 "
17
- version=$( jq -r ' .version' " packages/$pkg /package.json" )
16
+ pkg=" $1 "
17
+ version=$( jq -r ' .version' " packages/$pkg /package.json" )
18
18
19
- clean_root " $pkg "
20
- mv " packages/$pkg /{src,README.md}" .
21
- rm -fr " packages/$pkg "
19
+ git checkout -b " $pkg "
22
20
23
- git checkout -b " $package "
24
- git commit -am " $version "
25
- git push origin " $package "
21
+ clean " $pkg "
22
+ mv " packages/$pkg /{src,README.md}" .
23
+ rm -fr " packages/$pkg "
24
+ git commit -am " $version "
25
+ git push origin " $pkg "
26
+
27
+ git checkout main
28
+
29
+ }
30
+
31
+ publish_forge_pkgs () {
32
+ # http://mywiki.wooledge.org/BashFAQ/001
33
+ # https://github.com/koalaman/shellcheck/wiki/SC2012
34
+ find packages -maxdepth 1 -mindepth 1 -printf ' %P\n' | while read -r pkg; do
35
+ publish_forge_pkg " $pkg "
36
+ done
26
37
}
27
38
28
39
main () {
29
- pkg=" $1 "
30
- clean_root " $pkg "
31
- publish_forge
32
- # TODO: uncomment
33
- # publish_npm
40
+ publish_forge_pkgs
41
+ # TODO: uncomment
42
+ # publish_npm
34
43
}
35
44
36
- main " $@ "
45
+ main
You can’t perform that action at this time.
0 commit comments