Skip to content

Commit 18673f9

Browse files
committed
snapshot
1 parent d46a73d commit 18673f9

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

.github/workflows/build-toolbox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: |
4747
set -euo pipefail
4848
cd toolbox
49-
./toolbox-builder -yaml ../playbook/60-second-linux.yaml -out toolbox-${{ matrix.arch_tag }}.tar.xz
49+
./toolbox-builder -playbook ../playbook/60-second-linux.yaml -out toolbox-${{ matrix.arch_tag }}.tar.xz
5050
5151
- name: Upload artifact
5252
uses: actions/upload-artifact@v4

toolbox/generate.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,28 @@ import (
1717
)
1818

1919
func main() {
20-
var yamlPath string
20+
var playbookPath string
2121
var outPath string
2222

23-
flag.StringVar(&yamlPath, "yaml", "", "Path to YAML with nixpkgs.packages")
23+
flag.StringVar(&playbookPath, "playbook", "", "Path to playbook file")
2424
flag.StringVar(&outPath, "out", "toolbox.tar.xz", "Output archive path")
2525
flag.Parse()
2626

27-
if yamlPath == "" {
28-
fmt.Fprintln(os.Stderr, "error: -yaml path is required")
27+
if playbookPath == "" {
28+
fmt.Fprintln(os.Stderr, "error: -playbook path is required")
2929
os.Exit(2)
3030
}
3131
if runtime.GOOS != "linux" {
3232
fmt.Fprintln(os.Stderr, "error: this utility must run on Linux")
3333
os.Exit(2)
3434
}
3535

36-
cfg, err := readYAML(yamlPath)
36+
cfg, err := readPlaybook(playbookPath)
3737
if err != nil {
38-
fatalf("failed to read YAML: %v", err)
38+
fatalf("failed to read playbook: %v", err)
3939
}
4040
if len(cfg.Nixpkgs.Packages) == 0 {
41-
fatalf("no nixpkgs.packages listed in %s", yamlPath)
41+
fatalf("no nixpkgs.packages listed in %s", playbookPath)
4242
}
4343

4444
workDir, err := os.MkdirTemp("", "toolbox_work_*")
@@ -59,9 +59,9 @@ func main() {
5959
fatalf("failed to install proot: %v", err)
6060
}
6161

62-
// Include the playbook YAML inside the toolbox directory
63-
if err := copyFile(yamlPath, filepath.Join(toolboxDir, "playbook.yaml"), 0o644); err != nil {
64-
fatalf("failed to copy playbook YAML: %v", err)
62+
// Include the playbook file inside the toolbox directory
63+
if err := copyFile(playbookPath, filepath.Join(toolboxDir, "playbook.yaml"), 0o644); err != nil {
64+
fatalf("failed to copy playbook file: %v", err)
6565
}
6666

6767
outPath, _ = filepath.Abs(outPath)
@@ -72,7 +72,7 @@ func main() {
7272
fmt.Printf("created %s\n", outPath)
7373
}
7474

75-
func readYAML(path string) (*playbook.PlaybookConfig, error) {
75+
func readPlaybook(path string) (*playbook.PlaybookConfig, error) {
7676
data, err := os.ReadFile(path)
7777
if err != nil {
7878
return nil, err

0 commit comments

Comments
 (0)