Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows command runner #20

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Arcath
Copy link

@Arcath Arcath commented Oct 15, 2015

Fixes #19 by using cmd.exe /C instead of /bin/bash -c when the platform is win32

Also ignore node_modules/ (my first git add went nuts with the whole node_modules folder)

@evanlucas
Copy link
Owner

I think I would prefer something more like:

var sh = '/bin/bash'
var flag = '-c'

if (process.platform === 'win32') {
  sh = process.env.comspec || 'cmd'
  flag = '/C'
}

var child = spawn(sh, [flag, fixedCmd.join(' ')], opts)

The thing I would want to confirm is that this does not break for users using git-bash vs the windows command prompt...

@Arcath
Copy link
Author

Arcath commented Oct 15, 2015

@evanlucas Good point, maybe if there sh and flag options on the command line? that way I can supply `gcr --shell cmd.exe --shell-flag "/C" to override the defaults and gcr then gain support for any environment instead of assuming that every one has /bin/bash

@evanlucas
Copy link
Owner

Yea, I'd be fine with that

will use travis to ensure they still pass online
@Arcath
Copy link
Author

Arcath commented Oct 19, 2015

I needed the tests working before I continue, will look at adding the options soon

@Arcath
Copy link
Author

Arcath commented Oct 19, 2015

Using this fork my runner now works fine

@bushong1
Copy link
Collaborator

Hey @Arcath, I'm trying to get these PRs taken care of. Can you fix the conflicts and rebase off master? Also, you'll need to fix the command line shorthand options to not conflict with existing options, and be 1 character.

@ReeganExE
Copy link

Any update on this, guys?

@bushong1 bushong1 self-assigned this Oct 11, 2016
Copy link
Collaborator

@bushong1 bushong1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for a rebase and resolution of conflicts.

@@ -36,6 +36,8 @@ gcr - a gitlab ci runner
-s, --strictSSL enable/disable strict ssl
-n, --npm run npm install/test if no commands are present
-k, --keypath <path> specify path to rsa key
-s, --shell <path> specify path to shell e.g. /bin/bash
-sf, --shellFlag <flag> set the flag to run commands on your shell e.g. -c
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need single character only for - flags.

@@ -84,7 +94,7 @@ test('build and run with clone', (t) => {
t.ok(build.hasOwnProperty('opts'), 'hasOwnProperty(opts)')
t.ok(build.hasOwnProperty('output'), 'hasOwnProperty(output)')
t.ok(build.hasOwnProperty('projectDir'), 'hasOwnProperty(projectDir)')
t.equal(build.projectDir, '/tmp/gcr-builds/project-1')
t.equal(build.projectDir, path.join('/', 'tmp', 'gcr-builds', 'project-1'))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the tests having the path seperator / hard coded. Windows can pass this no problem but its returned paths use \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants