@@ -18,8 +18,15 @@ const env_vars = {
18
18
}
19
19
20
20
console . 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
+ }
23
30
24
31
if ( ! DIR ) {
25
32
throw new Error ( 'please specify CODE_GOV_DIR as an env variable' )
@@ -30,28 +37,27 @@ const options = {
30
37
repo :
process . env . CODE_GOV_REPO || '[email protected] :GSA/code-gov-front-end'
31
38
}
32
39
33
- console . log ( 'options:' , options )
34
-
35
40
if ( process . env . CODE_GOV_BRANCH ) {
36
41
options . branch = process . env . CODE_GOV_BRANCH
37
42
} else {
38
43
throw new Error ( 'no branch specified' )
39
44
}
40
45
41
- //if (!process.env.CODE_GOV_REPO) {
46
+ console . log ( 'options:' , options )
47
+ // if (!process.env.CODE_GOV_REPO) {
42
48
// throw new Error("no repo specified")
43
- //}
49
+ // }
44
50
//
45
- //if (!process.env.CODE_GOV_API_KEY) {
51
+ // if (!process.env.CODE_GOV_API_KEY) {
46
52
// throw new Error("no api specified")
47
- //}
53
+ // }
48
54
49
- //ghpages.clean()
55
+ // ghpages.clean()
50
56
//
51
- //ghpages.publish(DIR, options, err => {
57
+ // ghpages.publish(DIR, options, err => {
52
58
// if (err) {
53
59
// console.error(err);
54
60
// } else {
55
61
// console.log("published successfully");
56
62
// }
57
- //});
63
+ // });
0 commit comments