@@ -18,8 +18,15 @@ const env_vars = {
1818}
1919
2020console . log ( 'env_vars' , env_vars )
21- console . log ( 'unlinking ./dist/.gitignore' )
22- fs . unlinkSync ( './dist/.gitignore' )
21+
22+ try {
23+ if ( fs . existsSync ( './dist/.gitignore' ) ) {
24+ console . log ( 'unlinking ./dist/.gitignore' )
25+ fs . unlinkSync ( './dist/.gitignore' )
26+ }
27+ } catch ( err ) {
28+ console . log ( err )
29+ }
2330
2431if ( ! DIR ) {
2532 throw new Error ( 'please specify CODE_GOV_DIR as an env variable' )
@@ -30,28 +37,27 @@ const options = {
3037 repo : process . env . CODE_GOV_REPO || 'git@github.com:GSA/code-gov-front-end'
3138}
3239
33- console . log ( 'options:' , options )
34-
3540if ( process . env . CODE_GOV_BRANCH ) {
3641 options . branch = process . env . CODE_GOV_BRANCH
3742} else {
3843 throw new Error ( 'no branch specified' )
3944}
4045
41- //if (!process.env.CODE_GOV_REPO) {
46+ console . log ( 'options:' , options )
47+ // if (!process.env.CODE_GOV_REPO) {
4248// throw new Error("no repo specified")
43- //}
49+ // }
4450//
45- //if (!process.env.CODE_GOV_API_KEY) {
51+ // if (!process.env.CODE_GOV_API_KEY) {
4652// throw new Error("no api specified")
47- //}
53+ // }
4854
49- //ghpages.clean()
55+ // ghpages.clean()
5056//
51- //ghpages.publish(DIR, options, err => {
57+ // ghpages.publish(DIR, options, err => {
5258// if (err) {
5359// console.error(err);
5460// } else {
5561// console.log("published successfully");
5662// }
57- //});
63+ // });
0 commit comments