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

use execa for better windows support #40

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

Conversation

tunnckoCore
Copy link
Contributor

Probably fixes #22. Plus better handling of python and actually the shorthands for those "languages".

Sorry that it's in one big commit, it was impossible in another way.

The thing is the following: a) When bash, we don't pass bash or sh or -c to the the exec call, so it can be handled by execa (i belive it switches between what's needed depending on platform?). b) If code block is python or py pass python -c to the command call. c) otherwise just call whatever is the codeblock.

The tests snapshots are intentionally updated, because was required too. We should trim the incoming code fence block content, because it may lead to errors in python for example.

Signed-off-by: Charlike Mike Reagent <olsten.larck@gmail.com>
@tunnckoCore
Copy link
Contributor Author

tunnckoCore commented Jun 6, 2018

dooooh "Bad substitution" error on the CI :D i didn't have that problem, but yea.. I'm on ArchLinux. Probably should add again bash -c.

edit: but adding [type, '-c', ...] will defeat the purpose of this PR, duh. The whole point is to not add any flags or bash/zsh/sh so to work on windows, because the execa. doooooooh.

Charlike Mike Reagent added 2 commits June 6, 2018 23:39
Signed-off-by: Charlike Mike Reagent <olsten.larck@gmail.com>
Signed-off-by: Charlike Mike Reagent <olsten.larck@gmail.com>
@@ -22,6 +22,7 @@
"cac": "^5.0.10",
"chalk": "^2.4.1",
"cross-spawn": "^6.0.5",

Choose a reason for hiding this comment

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

Wanna take this out if it isn't being used anymore?

Copy link
Contributor Author

@tunnckoCore tunnckoCore Jun 7, 2018

Choose a reason for hiding this comment

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

oh yea, forgot about that.. thanks.

let script = null

if (isShell) {
script = [task.script, ...args]
Copy link
Owner

Choose a reason for hiding this comment

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

hmm does this work? maid log hello world:

## log

```sh
echo $1;
echo $2;
```

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably yes. the readme scripts works, so. but not sure how to handle the windows yet ;/

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.

Windows support on the bash/sh code
3 participants