File tree 3 files changed +49
-2
lines changed 3 files changed +49
-2
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
2
node_modules
3
- /dist
3
+ # /dist
4
4
5
5
# local env files
6
6
.env.local
@@ -19,3 +19,5 @@ yarn-error.log*
19
19
* .njsproj
20
20
* .sln
21
21
* .sw ?
22
+
23
+ vue.config.js
Original file line number Diff line number Diff line change
1
+ const exec = require ( 'child_process' ) . exec ;
2
+
3
+ const commitMessage = process . argv [ 2 ] ;
4
+
5
+ function execute ( command ) {
6
+ return new Promise ( ( resolve , reject ) => {
7
+ exec ( command ,
8
+ function ( error , stdout , stderr ) {
9
+ if ( error ) {
10
+ console . log ( "error1" , error )
11
+ console . log ( "stderr" , stderr )
12
+ reject ( stderr )
13
+ }
14
+
15
+ resolve ( stdout )
16
+ }
17
+ )
18
+ } )
19
+ }
20
+
21
+ async function start ( ) {
22
+ // console.log('commitMessage', commitMessage)
23
+ // return
24
+
25
+ try {
26
+ console . log ( 'Building...' )
27
+ await execute ( 'npm run build' )
28
+
29
+ console . log ( 'Adding the dist...' )
30
+ await execute ( `git add dist` )
31
+
32
+ console . log ( 'Commiting' )
33
+ await execute ( `git commit -m "${ commitMessage } "` )
34
+
35
+ console . log ( 'Pushing to gh' )
36
+ await execute ( 'git subtree push --prefix dist origin gh-pages' )
37
+
38
+ console . log ( 'The project was deployed on Gh-pages! Good work!' )
39
+ } catch ( error ) {
40
+ console . log ( 'error' , error )
41
+ }
42
+ }
43
+
44
+ start ( )
Original file line number Diff line number Diff line change 5
5
"scripts" : {
6
6
"serve" : " vue-cli-service serve" ,
7
7
"build" : " vue-cli-service build" ,
8
- "lint" : " vue-cli-service lint" ,
8
+ "lint" : " vue-cli-service lint" ,
9
+ "deploy:gh-pages" : " node deployGhPages.js" ,
9
10
"docs:generate" : " vuedoc.md.cmd ./src/components/player.vue --output PLAYER.md" ,
10
11
"test:unit" : " vue-cli-service test:unit"
11
12
},
You can’t perform that action at this time.
0 commit comments