@@ -9,7 +9,15 @@ import {
9
9
import path from 'path'
10
10
import simpleGit , { Response } from 'simple-git'
11
11
import YAML from 'js-yaml'
12
- import { getInput , Input , log , outputs , parseBool , setOutput } from './util'
12
+ import {
13
+ getInput ,
14
+ Input ,
15
+ log ,
16
+ matchGitArgs ,
17
+ outputs ,
18
+ parseBool ,
19
+ setOutput
20
+ } from './util'
13
21
14
22
const baseDir = path . join ( process . cwd ( ) , getInput ( 'cwd' ) || '' )
15
23
const git = simpleGit ( { baseDir } )
@@ -90,7 +98,7 @@ console.log(`Running in ${baseDir}`)
90
98
if ( getInput ( 'tag' ) ) {
91
99
info ( '> Tagging commit...' )
92
100
await git
93
- . tag ( getInput ( 'tag' ) . split ( ' ' ) , ( err , data ?) => {
101
+ . tag ( matchGitArgs ( getInput ( 'tag' ) ) , ( err , data ?) => {
94
102
if ( data ) setOutput ( 'tagged' , 'true' )
95
103
return log ( err , data )
96
104
} )
@@ -122,7 +130,7 @@ console.log(`Running in ${baseDir}`)
122
130
await git . push (
123
131
undefined ,
124
132
undefined ,
125
- pushOption . split ( ' ' ) ,
133
+ matchGitArgs ( pushOption ) ,
126
134
( err , data ?) => {
127
135
if ( data ) setOutput ( 'pushed' , 'true' )
128
136
return log ( err , data )
@@ -143,9 +151,9 @@ console.log(`Running in ${baseDir}`)
143
151
{
144
152
'--delete' : null ,
145
153
origin : null ,
146
- [ getInput ( 'tag' )
147
- . split ( ' ')
148
- . filter ( ( w ) => ! w . startsWith ( '-' ) ) [ 0 ] ] : null
154
+ [ matchGitArgs ( getInput ( 'tag' ) ) . filter (
155
+ ( w ) => ! w . startsWith ( '- ')
156
+ ) [ 0 ] ] : null
149
157
} ,
150
158
log
151
159
)
@@ -291,7 +299,7 @@ async function add({ logWarning = true, ignoreErrors = false } = {}): Promise<
291
299
// Push the result of every git command (which are executed in order) to the array
292
300
// If any of them fails, the whole function will return a Promise rejection
293
301
await git
294
- . add ( args . split ( ' ' ) , ( err : any , data ?: any ) =>
302
+ . add ( matchGitArgs ( args ) , ( err : any , data ?: any ) =>
295
303
log ( ignoreErrors ? null : err , data )
296
304
)
297
305
. catch ( ( e : Error ) => {
@@ -325,7 +333,7 @@ async function remove({
325
333
// Push the result of every git command (which are executed in order) to the array
326
334
// If any of them fails, the whole function will return a Promise rejection
327
335
await git
328
- . rm ( args . split ( ' ' ) , ( e : any , d ?: any ) =>
336
+ . rm ( matchGitArgs ( args ) , ( e : any , d ?: any ) =>
329
337
log ( ignoreErrors ? null : e , d )
330
338
)
331
339
. catch ( ( e : Error ) => {
0 commit comments