Commit c4c771db authored by Kamil Trzciński's avatar Kamil Trzciński 🔴

Create directory before saving file

parent 135d7556
......@@ -57,6 +57,7 @@ func (b *BashShell) GenerateScript(build *common.Build, shellType common.ShellTy
io.WriteString(w, "#!/usr/bin/env bash\n")
io.WriteString(w, "\n")
io.WriteString(w, "# save script that is read from to file and execute script file on remote server\n")
io.WriteString(w, fmt.Sprintf("mkdir -p %s\n", helpers.ShellEscape(projectDir)))
io.WriteString(w, fmt.Sprintf("cat > %s && exec $0 %s; exit 1\n", projectScript, projectScript))
io.WriteString(w, "\n")
if len(build.Hostname) != 0 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment