Example #1
0
func mustCreateReposDir(config Config, fs boshsys.FileSystem, eventLog bpeventlog.Log) {
	err := fs.MkdirAll(config.ReposDir, os.ModeDir)
	if err != nil {
		eventLog.WriteErr(bosherr.WrapError(err, "Creating repos dir"))
		os.Exit(1)
	}
}
Example #2
0
func mustSetTmpDir(config Config, fs boshsys.FileSystem, eventLog bpeventlog.Log) {
	// todo leaky abstraction?
	if len(config.TmpDir) == 0 {
		return
	}

	err := fs.MkdirAll(config.TmpDir, os.ModeDir)
	if err != nil {
		eventLog.WriteErr(bosherr.WrapError(err, "Creating tmp dir"))
		os.Exit(1)
	}

	err = os.Setenv("TMPDIR", config.TmpDir)
	if err != nil {
		eventLog.WriteErr(bosherr.WrapError(err, "Setting TMPDIR"))
		os.Exit(1)
	}
}