Skip to content

Commit

Permalink
removed temp files
Browse files Browse the repository at this point in the history
  • Loading branch information
brett-hodges committed Oct 5, 2024
1 parent 5c0a2f1 commit e18bfa0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
44 changes: 44 additions & 0 deletions build/homebrew/create-homebrew-recipe.awk
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);
}
3 changes: 0 additions & 3 deletions build/homebrew/homebrew-metadata.txt

This file was deleted.

0 comments on commit e18bfa0

Please sign in to comment.