Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cookbook
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Wildan Mubarok
cookbook
Commits
02654031
Verified
Commit
02654031
authored
4 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Run cookbook rust version for fetch, if possible
parent
4961de86
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fetch.sh
+6
-0
6 additions, 0 deletions
fetch.sh
src/bin/cook.rs
+6
-2
6 additions, 2 deletions
src/bin/cook.rs
with
12 additions
and
2 deletions
fetch.sh
+
6
−
0
View file @
02654031
...
...
@@ -12,5 +12,11 @@ fi
for
recipe
in
$recipes
do
if
[
-e
"recipes/
$recipe
/recipe.toml"
]
then
target/release/cook
--fetch-only
"
$recipe
"
continue
fi
./cook.sh
"
$recipe
"
fetch
done
This diff is collapsed.
Click to expand it.
src/bin/cook.rs
+
6
−
2
View file @
02654031
...
...
@@ -557,12 +557,14 @@ fn package(recipe_dir: &Path, stage_dir: &Path, package: &PackageRecipe) -> Resu
Ok
(
package_file
)
}
fn
cook
(
recipe_dir
:
&
Path
,
recipe
:
&
Recipe
)
->
Result
<
(),
String
>
{
fn
cook
(
recipe_dir
:
&
Path
,
recipe
:
&
Recipe
,
fetch_only
:
bool
)
->
Result
<
(),
String
>
{
let
source_dir
=
fetch
(
&
recipe_dir
,
&
recipe
.source
)
.map_err
(|
err
|
format!
(
"failed to fetch: {}"
,
err
))
?
;
if
fetch_only
{
return
Ok
(());
}
let
stage_dir
=
build
(
&
recipe_dir
,
&
source_dir
,
&
recipe
.build
)
.map_err
(|
err
|
format!
(
"failed to build: {}"
,
err
...
...
@@ -658,12 +660,14 @@ impl CookRecipe {
fn
main
()
{
let
mut
matching
=
true
;
let
mut
dry_run
=
false
;
let
mut
fetch_only
=
false
;
let
mut
quiet
=
false
;
let
mut
recipe_names
=
Vec
::
new
();
for
arg
in
env
::
args
()
.skip
(
1
)
{
match
arg
.as_str
()
{
"--"
if
matching
=>
matching
=
false
,
"-d"
|
"--dry-run"
if
matching
=>
dry_run
=
true
,
"--fetch-only"
if
matching
=>
fetch_only
=
true
,
"-q"
|
"--quiet"
if
matching
=>
quiet
=
true
,
_
=>
recipe_names
.push
(
arg
),
}
...
...
@@ -702,7 +706,7 @@ fn main() {
}
Ok
(())
}
else
{
cook
(
&
recipe
.dir
,
&
recipe
.recipe
)
cook
(
&
recipe
.dir
,
&
recipe
.recipe
,
fetch_only
)
};
match
res
{
...
...
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