Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
installer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
installer
Commits
15d37cea
Commit
15d37cea
authored
7 years ago
by
Jeremy Soller
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #4 from ids1024/list
--list-packages argument
parents
d6f2936a
e47108a7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/installer.rs
+11
-1
11 additions, 1 deletion
src/bin/installer.rs
with
11 additions
and
1 deletion
src/bin/installer.rs
+
11
−
1
View file @
15d37cea
...
@@ -15,6 +15,7 @@ fn main() {
...
@@ -15,6 +15,7 @@ fn main() {
let
mut
configs
=
vec!
[];
let
mut
configs
=
vec!
[];
let
mut
cookbook
=
None
;
let
mut
cookbook
=
None
;
let
mut
list_packages
=
false
;
for
arg
in
env
::
args
()
.skip
(
1
)
{
for
arg
in
env
::
args
()
.skip
(
1
)
{
if
arg
.starts_with
(
"--cookbook="
)
{
if
arg
.starts_with
(
"--cookbook="
)
{
let
path
=
arg
.splitn
(
2
,
"--cookbook="
)
.nth
(
1
)
.unwrap
()
.to_string
();
let
path
=
arg
.splitn
(
2
,
"--cookbook="
)
.nth
(
1
)
.unwrap
()
.to_string
();
...
@@ -27,6 +28,11 @@ fn main() {
...
@@ -27,6 +28,11 @@ fn main() {
continue
;
continue
;
}
}
if
arg
==
"--list-packages"
{
list_packages
=
true
;
continue
;
}
match
File
::
open
(
&
arg
)
{
match
File
::
open
(
&
arg
)
{
Ok
(
mut
config_file
)
=>
{
Ok
(
mut
config_file
)
=>
{
let
mut
config_data
=
String
::
new
();
let
mut
config_data
=
String
::
new
();
...
@@ -72,7 +78,11 @@ fn main() {
...
@@ -72,7 +78,11 @@ fn main() {
}
}
for
config
in
configs
{
for
config
in
configs
{
if
let
Err
(
err
)
=
redox_installer
::
install
(
config
,
cookbook
.as_ref
()
.map
(
String
::
as_ref
))
{
if
list_packages
{
for
(
packagename
,
_package
)
in
&
config
.packages
{
println!
(
"{}"
,
packagename
);
}
}
else
if
let
Err
(
err
)
=
redox_installer
::
install
(
config
,
cookbook
.as_ref
()
.map
(
String
::
as_ref
))
{
writeln!
(
stderr
,
"installer: failed to install: {}"
,
err
)
.unwrap
();
writeln!
(
stderr
,
"installer: failed to install: {}"
,
err
)
.unwrap
();
process
::
exit
(
1
);
process
::
exit
(
1
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment