@@ -17,28 +17,28 @@ import (
1717)
1818
1919func 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