提交 8072057d 编写于 作者: P Priya Wadhwa

Create dir

上级 e3226bc6
......@@ -20,6 +20,8 @@ package schedule
import (
"fmt"
"os/exec"
"path/filepath"
"time"
"github.com/pkg/errors"
......@@ -91,6 +93,9 @@ func startSystemdService(profile string, duration time.Duration) error {
if err != nil {
return errors.Wrap(err, "getting command runner")
}
if rr, err := runner.RunCmd(exec.Command("sudo", "mkdir", "-p", filepath.Dir(constants.ScheduledStopEnvFile))); err != nil {
return errors.Wrapf(err, "creating dirs: %v", rr.Output())
}
// update environment file to include duration
if err := runner.Copy(environmentFile(duration)); err != nil {
return errors.Wrap(err, "copying scheduled stop env file")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册