Created
November 15, 2018 06:23
-
-
Save RootUp/189645808a9e8a51fa36af7bdfde70af to your computer and use it in GitHub Desktop.
Mozilla PDF.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.task('baseline', function (done) { | |
console.log(); | |
console.log('### Creating baseline environment'); | |
var baselineCommit = process.env['BASELINE']; | |
if (!baselineCommit) { | |
done(new Error('Missing baseline commit. Specify the BASELINE variable.')); | |
return; | |
} | |
var initializeCommand = 'git fetch origin'; | |
if (!checkDir(BASELINE_DIR)) { | |
mkdirp.sync(BASELINE_DIR); | |
initializeCommand = 'git clone ../../ .'; | |
} | |
var workingDirectory = path.resolve(process.cwd(), BASELINE_DIR); | |
exec(initializeCommand, { cwd: workingDirectory, }, function (error) { | |
if (error) { | |
done(new Error('Baseline clone/fetch failed.')); | |
return; | |
} | |
exec('git checkout ' + baselineCommit, { cwd: workingDirectory, }, | |
function (error) { | |
if (error) { | |
done(new Error('Baseline commit checkout failed.')); | |
return; | |
} | |
console.log('Baseline commit "' + baselineCommit + '" checked out.'); | |
done(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment