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

Fail on alpine 9 (Docker - Chrominum) #14

Closed
mnadeau2 opened this issue Aug 27, 2018 · 1 comment · Fixed by #15
Closed

Fail on alpine 9 (Docker - Chrominum) #14

mnadeau2 opened this issue Aug 27, 2018 · 1 comment · Fixed by #15
Assignees
Labels

Comments

@mnadeau2
Copy link

mnadeau2 commented Aug 27, 2018

When running in Docker using Alpine 9 image, the chrome-finder fail by expecting a parameter not available in grep. (See official Chrome puppeter documentation for example image). The current work around is to detect docker/unsupported grep and conditionnaly use chrome-finder (not ideal)

The following code:
const chromeFinder = require("chrome-finder"); chromeExecutablePath = chromeFinder();
fail with an exception and console ouput:
`
grep: unrecognized option: R
BusyBox v1.26.2 (2018-05-30 13:51:20 GMT) multi-call binary.

Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

    -H      Add 'filename:' prefix
    -h      Do not add 'filename:' prefix
    -n      Add 'line_no:' prefix
    -l      Show only names of files that match
    -L      Show only names of files that don't match
    -c      Show only count of matching lines
    -o      Show only the matching part of line
    -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
    -v      Select non-matching lines
    -s      Suppress open and read errors
    -r      Recurse
    -i      Ignore case
    -w      Match whole words only
    -x      Match whole lines only
    -F      PATTERN is a literal (not regexp)
    -E      PATTERN is an extended regexp
    -m N    Match up to N times per file
    -A N    Print N lines of trailing context
    -B N    Print N lines of leading context
    -C N    Same as '-A N -B N'
    -e PTRN Pattern to match
    -f FILE Read pattern from file

`

@nros
Copy link
Collaborator

nros commented Aug 28, 2018

Thank you very much, I'll look into it and will try to find a solution.

nros added a commit to nros/chrome-finder that referenced this issue Aug 28, 2018
some grep versions do not support recursive search, eg: busybox
Because `find` seems to be available on nearly all platforms,
this is used instead to walk the directories and call grep
on each "*.desktop" file.

see: gwuhaolin#14

fix and close gwuhaolin#14
@nros nros self-assigned this Aug 28, 2018
@nros nros added the bug label Aug 28, 2018
gwuhaolin added a commit that referenced this issue Aug 29, 2018
fix #14 use "find" instead of recursive "grep"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants