forked from jozu-ai/kitops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c0a2f1
commit e18bfa0
Showing
2 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Usage: awk -f create-homebrew-recipe.awk homebrew-metadata.txt | ||
|
||
BEGIN { | ||
template = "kitops.rb.template"; | ||
recipe = "kitops.rb"; | ||
} | ||
|
||
{ | ||
# Read relevant fields from input file | ||
# (intended to be homebrew-metadata.txt) | ||
shas[$3]=$1; | ||
urls[$3]=$2; | ||
version[$3]=$4; | ||
} | ||
|
||
END { | ||
# Read a line from template, replace special fields, | ||
# and print result to recipe file | ||
while ((getline ln < template) > 0) | ||
{ | ||
sub(/url @@darwin-arm64/, "url " urls["darwin-arm64"], ln); | ||
sub(/sha256 @@darwin-arm64/, "sha256 " shas["darwin-arm64"], ln); | ||
|
||
sub(/url @@darwin-x86_64/, "url " urls["darwin-x86_64"], ln); | ||
sub(/sha256 @@darwin-x86_64/, "sha256 " shas["darwin-x86_64"], ln); | ||
|
||
sub(/url @@linux-arm64/, "url " urls["linux-arm64"], ln); | ||
sub(/sha256 @@linux-arm64/, "sha256 " shas["linux-arm64"], ln); | ||
|
||
sub(/url @@linux-x86_64/, "url " urls["linux-x86_64"], ln); | ||
sub(/sha256 @@linux-x86_64/, "sha256 " shas["linux-x86_64"], ln); | ||
|
||
sub(/url @@linux-i386/, "url " urls["linux-i386"], ln); | ||
sub(/sha256 @@linux-i386/, "sha256 " shas["linux-i386"], ln); | ||
|
||
sub(/@@version/, version["darwin-arm64"], ln); | ||
|
||
print(ln) > recipe; | ||
} | ||
|
||
# Close template and recipe fields | ||
close(recipe); | ||
close(template); | ||
} |
This file was deleted.
Oops, something went wrong.