@@ -16,29 +16,29 @@ const path_1 = __importDefault(require("path"));
1616const signale_1 = __importDefault ( require ( "signale" ) ) ;
1717const child_process_1 = require ( "child_process" ) ;
1818const misc_1 = require ( "./misc" ) ;
19- exports . deploy = ( name , context ) => __awaiter ( this , void 0 , void 0 , function * ( ) {
19+ exports . deploy = ( branch , context ) => __awaiter ( this , void 0 , void 0 , function * ( ) {
2020 const workDir = path_1 . default . resolve ( misc_1 . getWorkspace ( ) , '.work' ) ;
2121 const buildDir = path_1 . default . resolve ( workDir , 'build' ) ;
2222 const pushDir = path_1 . default . resolve ( workDir , 'build' ) ;
23- signale_1 . default . info ( `Deploying branch %s to %s` , name , misc_1 . getRepository ( context ) ) ;
23+ signale_1 . default . info ( `Deploying branch %s to %s` , branch , misc_1 . getRepository ( context ) ) ;
2424 fs_1 . default . mkdirSync ( pushDir , { recursive : true } ) ;
2525 yield exports . prepareFiles ( buildDir , pushDir , context ) ;
26- yield cloneForBranch ( pushDir , name , context ) ;
26+ yield cloneForBranch ( pushDir , branch , context ) ;
2727 yield copyFiles ( buildDir , pushDir ) ;
2828 yield config ( pushDir ) ;
2929 yield commit ( pushDir ) ;
30- yield push ( pushDir , name , context ) ;
30+ yield push ( pushDir , branch , context ) ;
3131} ) ;
3232exports . prepareFiles = ( buildDir , pushDir , context ) => __awaiter ( this , void 0 , void 0 , function * ( ) {
33- signale_1 . default . info ( 'Preparing files for release' , name ) ;
33+ signale_1 . default . info ( 'Preparing files for release' ) ;
3434 fs_1 . default . mkdirSync ( buildDir , { recursive : true } ) ;
3535 yield cloneForBuild ( buildDir , context ) ;
3636 yield runBuild ( buildDir ) ;
3737} ) ;
38- const cloneForBranch = ( pushDir , name , context ) => __awaiter ( this , void 0 , void 0 , function * ( ) {
39- signale_1 . default . info ( `Cloning the branch %s from the remote repo` , name ) ;
38+ const cloneForBranch = ( pushDir , branch , context ) => __awaiter ( this , void 0 , void 0 , function * ( ) {
39+ signale_1 . default . info ( `Cloning the branch %s from the remote repo` , branch ) ;
4040 const url = misc_1 . getGitUrl ( context ) ;
41- yield execAsync ( `git -C ${ pushDir } clone --quiet --branch=${ name } --depth=1 ${ url } .` , true ) ;
41+ yield execAsync ( `git -C ${ pushDir } clone --quiet --branch=${ branch } --depth=1 ${ url } .` , true ) ;
4242} ) ;
4343const config = ( pushDir ) => __awaiter ( this , void 0 , void 0 , function * ( ) {
4444 const name = misc_1 . getCommitName ( ) ;
@@ -53,10 +53,10 @@ const commit = (pushDir) => __awaiter(this, void 0, void 0, function* () {
5353 yield execAsync ( `git -C ${ pushDir } commit -qm "${ message } "` ) ;
5454 yield execAsync ( `git -C ${ pushDir } show --stat-count=10 HEAD` ) ;
5555} ) ;
56- const push = ( pushDir , name , context ) => __awaiter ( this , void 0 , void 0 , function * ( ) {
57- signale_1 . default . info ( 'Pushing to %s@%s' , misc_1 . getRepository ( context ) , name ) ;
56+ const push = ( pushDir , branch , context ) => __awaiter ( this , void 0 , void 0 , function * ( ) {
57+ signale_1 . default . info ( 'Pushing to %s@%s' , misc_1 . getRepository ( context ) , branch ) ;
5858 const url = misc_1 . getGitUrl ( context ) ;
59- yield execAsync ( `git -C ${ pushDir } push --quiet "${ url } " "${ name } ":"${ name } "` , true ) ;
59+ yield execAsync ( `git -C ${ pushDir } push --quiet "${ url } " "${ branch } ":"${ branch } "` , true ) ;
6060} ) ;
6161const cloneForBuild = ( buildDir , context ) => __awaiter ( this , void 0 , void 0 , function * ( ) {
6262 signale_1 . default . info ( 'Cloning the working commit from the remote repo for build' ) ;
0 commit comments