// EnvSubst expands environment variable references in a file with the value of
// the current testscript environment.
EnvSubst expands environment variable references in a file with the value of
the current testscript environment.
// EnvSubst expands environment variable references in a file with the value of // the current testscript environment .
func EnvSubst(ts *testscript.TestScript, neg bool, args []string) {
	if neg {
		ts.Fatalf("envsubst does not support negation of the command")
	}
	if len(args) == 0 {
		ts.Fatalf("need to supply at least one filename")
	}
	for _, f := range args {
		f = ts.MkAbs(f)
		fc := ts.ReadFile(f)
		fc = os.Expand(fc, func(v string) string {
			return ts.Getenv(v)
		})
		ts.Check(ioutil.WriteFile(f, []byte(fc), 0666))
	}
}
func EnvSubst ( ts * testscript . TestScript , neg bool , args [ ] string ) { if neg { ts . Fatalf ( " " ) } if len ( args ) == 0 { ts . Fatalf ( " " ) } for _ , f := range args { f = ts . MkAbs ( f ) fc := ts . ReadFile ( f ) fc = os . Expand ( fc , func ( v string ) string { return ts . Getenv ( v ) } ) ts . Check ( ioutil . WriteFile ( f , [ ] byte ( fc ) , 0666 ) ) } }
EnvSubst expands environment variable references in a file with the value of
the current testscript environment.
EnvSubst expands environment variable references in a file with the value of the current testscript environment .