File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,18 @@ containerCommands.setup = [
1919 'echo '
2020] . join ( ' && ' ) ;
2121
22- containerCommands . runLocal = function ( commands ) {
22+
23+ containerCommands . getRunCmd = function ( commands , isCI ) {
24+ var _commands = Array . isArray ( commands ) ? commands . slice ( ) : [ commands ] ;
25+
26+ if ( isCI ) return getRunCI ( _commands ) ;
27+
28+ // add setup commands locally
29+ _commands = [ containerCommands . setup ] . concat ( _commands ) ;
30+ return getRunLocal ( _commands ) ;
31+ } ;
32+
33+ function getRunLocal ( commands ) {
2334 commands = [ containerCommands . cdHome ] . concat ( commands ) ;
2435
2536 return [
@@ -28,9 +39,9 @@ containerCommands.runLocal = function(commands) {
2839 '/bin/bash -c' ,
2940 '"' + commands . join ( ' && ' ) + '"'
3041 ] . join ( ' ' ) ;
31- } ;
42+ }
3243
33- containerCommands . runCI = function ( commands ) {
44+ function getRunCI ( commands ) {
3445 commands = [ 'export CIRCLECI=1' , containerCommands . cdHome ] . concat ( commands ) ;
3546
3647 return [
@@ -39,6 +50,6 @@ containerCommands.runCI = function(commands) {
3950 '-- bash -c' ,
4051 commands . join ( ' && ' )
4152 ] . join ( ' ' ) ;
42- } ;
53+ }
4354
4455module . exports = containerCommands ;
You can’t perform that action at this time.
0 commit comments