Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions scm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ function scm:downloadPastebin (sourceObject, code, targetDirectory, updateObj)
end

if sourceObject.type == "program" then
shell.run("pastebin", "get", code, sourceObject.name .. ".lua")
shell.run("pastebin", "get", code, sourceObject.name)
else
shell.run("pastebin", "get", code, targetDirectory .. sourceObject.name .. ".lua")
shell.run("pastebin", "get", code, targetDirectory .. sourceObject.name)
end

return sourceObject, true
Expand Down Expand Up @@ -604,15 +604,15 @@ function scm:removeScript (name, keepScriptConfig)
local o = {}
local scriptType = nil

if keepScriptConfig ~= true then
for i = 1, #self.scripts, 1 do
if self.scripts[i].name ~= name then
table.insert(o, self.scripts[i])
else
scriptType = self.scripts[i].type
end
for i = 1, #self.scripts, 1 do
if self.scripts[i].name ~= name then
table.insert(o, self.scripts[i])
else
scriptType = self.scripts[i].type
end

end

if keepScriptConfig ~= true then
self.scripts = o
self:saveScripts()
end
Expand Down Expand Up @@ -662,6 +662,7 @@ function scm:updateScript (name, sourceName)
if self.scripts[i].name == name then
updateObj.source[sourceName] = self.scripts[i].source[sourceName]
updateObj.type = self.scripts[i].type
break
end
end

Expand Down