Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chromebrew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
chromebrew
Commits
cdec66ad
Commit
cdec66ad
authored
Jan 25, 2021
by
Kevin Perkins
Committed by
GitHub
Jan 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to enable/disable colorful output (#4996)
parent
d7c9bd8c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
15 deletions
+28
-15
crew
crew
+16
-13
lib/color.rb
lib/color.rb
+11
-1
lib/const.rb
lib/const.rb
+1
-1
No files found.
crew
View file @
cdec66ad
...
@@ -20,25 +20,27 @@ DOC = <<DOCOPT
...
@@ -20,25 +20,27 @@ DOC = <<DOCOPT
Chromebrew
-
Package
manager
for
Chrome
OS
http
://
skycocker
.
github
.
io
/
chromebrew
/
Chromebrew
-
Package
manager
for
Chrome
OS
http
://
skycocker
.
github
.
io
/
chromebrew
/
Usage
:
Usage
:
crew
build
[
-
k
|--
keep
]
[-
v
|--
verbose
]
<
name
>
...
crew
build
[
options
]
[-
k
|--
keep
]
<
name
>
...
crew
const
[<
name
>
...]
crew
const
[
options
]
[
<
name
>
...]
crew
download
[
-
v
|--
verbose
]
<
name
>
...
crew
download
[
options
]
<
name
>
...
crew
files
<
name
>
...
crew
files
[
options
]
<
name
>
...
crew
help
[<
command
>]
crew
help
[<
command
>]
crew
install
[
-
k
|--
keep
]
[-
s
|--
build
-
from
-
source
]
[-
S
|--
recursive
-
build
]
[-
v
|--
verbose
]
<
name
>
...
crew
install
[
options
]
[-
k
|--
keep
]
[-
s
|--
build
-
from
-
source
]
[-
S
|--
recursive
-
build
]
<
name
>
...
crew
list
(
available
|
installed
|
compatible
|
incompatible
)
crew
list
[
options
]
(
available
|
installed
|
compatible
|
incompatible
)
crew
postinstall
<
name
>
...
crew
postinstall
[
options
]
<
name
>
...
crew
reinstall
[
-
k
|--
keep
]
[-
s
|--
build
-
from
-
source
]
[-
S
|--
recursive
-
build
]
[-
v
|--
verbose
]
<
name
>
...
crew
reinstall
[
options
]
[-
k
|--
keep
]
[-
s
|--
build
-
from
-
source
]
[-
S
|--
recursive
-
build
]
<
name
>
...
crew
remove
[
-
v
|--
verbose
]
<
name
>
...
crew
remove
[
options
]
<
name
>
...
crew
search
[
-
v
|--
verbose
]
[<
name
>
...]
crew
search
[
options
]
[<
name
>
...]
crew
update
crew
update
[
options
]
crew
upgrade
[
-
k
|--
keep
]
[-
s
|--
build
-
from
-
source
]
[-
v
|--
verbos
e
]
[<
name
>
...]
crew
upgrade
[
options
]
[-
k
|--
keep
]
[-
s
|--
build
-
from
-
sourc
e
]
[<
name
>
...]
crew
whatprovides
<
name
>
...
crew
whatprovides
[
options
]
<
name
>
...
-
k
--
keep
Keep
the
`
CREW_BREW_DIR
`
(#{
CREW_BREW_DIR
})
directory
.
-
k
--
keep
Keep
the
`
CREW_BREW_DIR
`
(#{
CREW_BREW_DIR
})
directory
.
-
s
--
build
-
from
-
source
Build
from
source
even
if
pre
-
compiled
binary
exists
.
-
s
--
build
-
from
-
source
Build
from
source
even
if
pre
-
compiled
binary
exists
.
-
S
--
recursive
-
build
Build
from
source
,
including
all
dependencies
,
even
if
pre
-
compiled
binaries
exist
.
-
S
--
recursive
-
build
Build
from
source
,
including
all
dependencies
,
even
if
pre
-
compiled
binaries
exist
.
-
V
--
version
Display
the
crew
version
.
-
V
--
version
Display
the
crew
version
.
-
c
--
color
Use
colors
even
if
standard
out
is
not
a
tty
.
-
d
--
no
-
color
Disable
colors
even
if
standard
out
is
a
tty
.
-
v
--
verbose
Show
extra
information
.
-
v
--
verbose
Show
extra
information
.
-
h
--
help
Show
this
screen
.
-
h
--
help
Show
this
screen
.
...
@@ -76,6 +78,7 @@ rescue Docopt::Exit => e
...
@@ -76,6 +78,7 @@ rescue Docopt::Exit => e
exit
1
exit
1
end
end
String
.
use_color
=
args
[
"--color"
]
||
!args["--no-color"]
@
opt_keep
=
args
[
"--keep"
]
@
opt_keep
=
args
[
"--keep"
]
@
opt_verbose
=
args
[
"--verbose"
]
@
opt_verbose
=
args
[
"--verbose"
]
...
...
lib/color.rb
View file @
cdec66ad
# Colorization for strings
# Colorization for strings
class
String
class
String
@use_color
=
STDOUT
.
isatty
class
<<
self
attr_accessor
:use_color
end
def
colorize
(
color_code
,
shade
)
def
colorize
(
color_code
,
shade
)
"
\e
[
#{
shade
}
;
#{
color_code
}
m
#{
self
}
\e
[0m"
if
self
.
class
.
use_color
return
"
\e
[
#{
shade
}
;
#{
color_code
}
m
#{
self
}
\e
[0m"
else
return
self
end
end
end
def
black
def
black
...
...
lib/const.rb
View file @
cdec66ad
# Defines common constants used in different parts of crew
# Defines common constants used in different parts of crew
CREW_VERSION
=
'1.
6
.0'
CREW_VERSION
=
'1.
7
.0'
ARCH_ACTUAL
=
`uname -m`
.
strip
ARCH_ACTUAL
=
`uname -m`
.
strip
# This helps with virtualized builds on aarch64 machines
# This helps with virtualized builds on aarch64 machines
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment