File tree 4 files changed +31
-35
lines changed
4 files changed +31
-35
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ const queryGithub = require('../util/query-github');
3
3
module . exports = function checkVersions ( ) {
4
4
console . log ( `${ new Date ( ) . toString ( ) } : Checking for new versions` ) ;
5
5
return Promise . all ( [ get ( 'electron' ) , get ( 'module' ) ] )
6
- . then ( ( [ electronReleases , moduleReleases ] ) => {
6
+ . then ( ( [ moduleReleases , electronReleases ] ) => {
7
7
return {
8
- electron : electronReleases ,
9
- module : moduleReleases
8
+ moduleReleases ,
9
+ electronReleases
10
10
} ;
11
11
} ) ;
12
12
} ;
Original file line number Diff line number Diff line change 1
1
const checkVersions = require ( './check-versions' ) ;
2
2
const getConfig = require ( '../util/get-config' ) ;
3
- const makeTags = require ( './make-tags ' ) ;
3
+ const makeTag = require ( './make-tag ' ) ;
4
4
const pushTags = require ( './push-tags' ) ;
5
5
6
6
const pollInterval = getConfig ( 'poll_interval' ) ;
7
7
function runTagger ( ) {
8
- checkVersions ( )
9
- . then ( makeTags )
10
- . then ( ( tags ) => {
11
- if ( ! tags . length ) {
12
- return ;
13
- }
14
-
15
- return pushTags ( )
16
- . then ( ( ) => {
17
- console . log ( `${ new Date ( ) . toString ( ) } : pushed ${ tags . length } new tag(s)` ) ;
18
- } )
8
+ return pushTags ( )
9
+ . then ( checkVersions )
10
+ . then ( ( { moduleReleases, electronReleases} ) => {
11
+ var prom = Promise . resolve ( ) ;
12
+ moduleReleases . forEach ( ( moduleRelease ) => {
13
+ electronReleases . forEach ( ( electronRelease ) => {
14
+ prom = prom . then ( ( ) => {
15
+ return makeTag ( moduleRelease , electronRelease ) ;
16
+ } ) ;
17
+ } ) ;
18
+ } ) ;
19
+ return prom ;
19
20
} )
20
21
. catch ( ( reason ) => {
21
22
console . error ( `${ new Date ( ) . toString ( ) } : ${ reason } ` ) ;
Original file line number Diff line number Diff line change
1
+ const cp = require ( 'child_process' ) ;
2
+ const pushTags = require ( './push-tags' ) ;
3
+
4
+ module . exports = function makeTag ( moduleVersion , electronVersion ) {
5
+ var tags = cp . execSync ( 'git tag -l' ) . toString ( ) ;
6
+ var tagName = `ena-${ moduleVersion . tag_name } -${ electronVersion . tag_name } ` ;
7
+ if ( ! ~ tags . indexOf ( tagName ) ) {
8
+ cp . execSync ( `git tag ${ tagName } ` ) ;
9
+
10
+ return pushTags ( ) . then ( function ( ) {
11
+ console . log ( `pushed ${ tagName } ` ) ;
12
+ } ) ;
13
+ }
14
+ return Promise . resolve ( ) ;
15
+ } ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments