11
11
let
12
12
// node dependencies
13
13
process = require ( 'child_process' ) ,
14
+ fs = require ( 'fs' ) ,
14
15
15
16
npmPublish = require ( '@jsdevtools/npm-publish' ) ,
16
17
17
18
// config
18
19
release = require ( '../config/admin/release' ) ,
19
20
21
+ config = fs . existsSync ( __dirname + '/../config/admin/oauth.js' )
22
+ ? require ( '../config/admin/oauth' )
23
+ : false ,
24
+
20
25
// register components and distributions
21
26
repos = release . distributions . concat ( release . components ) ,
22
27
total = repos . length ,
26
31
stepRepo
27
32
;
28
33
29
- module . exports = function ( callback ) {
34
+ module . exports = async function ( callback ) {
30
35
31
- console . log ( 'Registering repos with package managers' ) ;
36
+ console . log ( 'Publishing main repo' ) ;
37
+ await npmPublish ( {
38
+ package : `./package.json` ,
39
+ token : config . npmToken ,
40
+ greaterVersionOnly : true ,
41
+ debug : function ( log ) {
42
+ console . log ( log ) ;
43
+ }
44
+ } ) ;
32
45
33
46
// Do Git commands synchronously per component, to avoid issues
34
47
stepRepo = async function ( ) {
@@ -40,10 +53,6 @@ module.exports = function(callback) {
40
53
}
41
54
42
55
let
43
- fs = require ( 'fs' ) ,
44
- config = fs . existsSync ( __dirname + '/../config/admin/oauth.js' )
45
- ? require ( '../config/admin/oauth' )
46
- : false ,
47
56
repo = repos [ index ] . toLowerCase ( ) ,
48
57
outputDirectory = `${ release . outputRoot } ${ repo } /` ,
49
58
exec = process . exec ,
0 commit comments