diff --git a/main.go b/main.go index a8ade4b..66a76fc 100644 --- a/main.go +++ b/main.go @@ -282,9 +282,13 @@ func writeBashScript(dl *DownloadLinks, folder string, scriptName string, produc dl.Filename = sanitizeName(pp[len(pp) - 1]) // Add the lines to the script + path := folder + "/" + sanitizeName(dl.InstallerName) + "/" + sanitizeName(dl.Os) + "/" + sanitizeName(dl.Language) + "/" + file := path + dl.Filename line := "echo \"[" + strconv.Itoa(productNumber) + " of " + strconv.Itoa(totalProducts) + "]{" + strconv.Itoa(fileNumber) + "/" + strconv.Itoa(totalFiles) + "}Getting installers for (" + dl.InstallerName + ")" + "\"\n" - line += "wget --no-clobber --continue --quiet --show-progress -O \"" + folder + "/" + sanitizeName(dl.InstallerName) + "/" + sanitizeName(dl.Os) + "/" + sanitizeName(dl.Language) + "/" + dl.Filename + ".xml\" \"" + dl.Checksum + "\"\n" - line += "wget --no-clobber --continue --quiet --show-progress -O \"" + folder + "/" + sanitizeName(dl.InstallerName) + "/" + sanitizeName(dl.Os) + "/" + sanitizeName(dl.Language) + "/" + dl.Filename + "\" \"" + dl.Downlink + "\"\n" + line += "wget --no-clobber --continue --quiet --show-progress -O \"" + file + ".xml\" \"" + dl.Checksum + "\"\n" + line += "wget --no-clobber --continue --quiet --show-progress -O \"" + file + "\" \"" + dl.Downlink + "\"\n" + line += "[ ! -f \"" + file + ".md5\" ] && cat \"" + file + ".xml\" | tr '\\n' '\\r' | sed -E 's| " + file + ".md5\n" + line += "! md5sum -c \"" + file + ".md5\" && rm \"" + file + "\" && echo \"Removed unmatched file: " + file + "\"\n" f, err := os.OpenFile("./" + scriptName, os.O_APPEND|os.O_WRONLY, 0664) if err != nil {