Update workdir to use default escape token

This commit is contained in:
Priya Wadhwa 2018-03-27 15:15:55 -07:00
parent 416c58e956
commit ad17811c39
No known key found for this signature in database
GPG Key ID: 0D0DAFD8F7AA73AE
1 changed files with 1 additions and 7 deletions

View File

@ -23,7 +23,6 @@ import (
"github.com/sirupsen/logrus"
"os"
"path/filepath"
"strings"
)
type WorkdirCommand struct {
@ -34,7 +33,7 @@ type WorkdirCommand struct {
func (w *WorkdirCommand) ExecuteCommand(config *manifest.Schema2Config) error {
logrus.Info("cmd: workdir")
workdirPath := w.cmd.Path
resolvedWorkingDir, err := util.ResolveEnvironmentReplacement(w.workdirToString(), workdirPath, config.Env, true)
resolvedWorkingDir, err := util.ResolveEnvironmentReplacement(workdirPath, config.Env, true)
if err != nil {
return err
}
@ -48,11 +47,6 @@ func (w *WorkdirCommand) ExecuteCommand(config *manifest.Schema2Config) error {
return os.MkdirAll(config.WorkingDir, 0755)
}
func (w *WorkdirCommand) workdirToString() string {
workdir := []string{"WORKDIR"}
return strings.Join(append(workdir, w.cmd.Path), " ")
}
// FilesToSnapshot returns the workingdir, which should have been created if it didn't already exist
func (w *WorkdirCommand) FilesToSnapshot() []string {
return w.snapshotFiles