mirror of
https://github.com/sbrow/ps.git
synced 2025-12-29 18:47:38 -05:00
Actually fixed doc.Dump
This commit is contained in:
@@ -202,17 +202,16 @@ func (d *Document) DumpFile() string {
|
||||
log.Println(err)
|
||||
}
|
||||
path := filepath.Join(strings.Replace(d.fullName, "~", usr.HomeDir, 1))
|
||||
path = strings.Replace(path, `/`, `\`, -1)
|
||||
path = strings.TrimPrefix(path, `\`)
|
||||
path = strings.Replace(path, `[^:]\`, `:\`, 1)
|
||||
drive := filepath.VolumeName(path)
|
||||
path = strings.Replace(path, drive, strings.ToUpper(drive), 1)
|
||||
path = strings.Replace(path, `\`, `:\`, 1)
|
||||
return strings.Replace(path, ".psd", ".json", 1)
|
||||
}
|
||||
|
||||
// Dump saves the document to disk in JSON format.
|
||||
func (d *Document) Dump() {
|
||||
log.Println("Dumping to disk")
|
||||
log.Println(d.DumpFile())
|
||||
log.Println(d.DumpFile(), d.FullName())
|
||||
defer d.Save()
|
||||
f, err := os.Create(d.DumpFile())
|
||||
if err != nil {
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
|
||||
// Windows is the runner Windows Operating Systems.
|
||||
// It runs Visual Basic Scripts.
|
||||
// // TODO(sbrow): Separate 32 and 64 bit Windows runners.
|
||||
var Windows = Runner{
|
||||
Cmd: "cscript.exe",
|
||||
Args: []string{"/nologo"},
|
||||
|
||||
Reference in New Issue
Block a user