Skip to content

Commit cb3cd8b

Browse files
ChristophLHRColdIV
andcommitted
resolves Issue-33
Co-authored-by: Josh <[email protected]>
1 parent 1388dff commit cb3cd8b

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

libs/scm/net.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ do
157157
.. config()[sourceObject.type .. "Suffix"]
158158
.. "/" .. filePaths[i], "w")
159159
end
160-
tmpfile.write(tmpContent)
161-
tmpfile.close()
160+
tmpFile.write(tmpContent)
161+
tmpFile.close()
162162
else
163163
success = false
164164
end
@@ -176,10 +176,10 @@ do
176176
-- create a link that calls the file within the program directory
177177
if sourceObject.type == "program" then
178178
local progamLink = fs.open(sourceObject.name, "w")
179-
progamLink:write("shell.execute(\"" .. targetDirectory .. sourceObject.name ..
179+
progamLink.write("shell.execute(\"" .. targetDirectory .. sourceObject.name ..
180180
config()[sourceObject.type .. "Suffix"]
181181
.. "/" .. sourceObject.name .. ".lua" .. "\", ...)")
182-
progamLink:close()
182+
progamLink.close()
183183
elseif sourceObject.type == "library" then
184184
local libraryLink = fs.open(targetDirectory .. sourceObject.name .. ".lua", "w")
185185
if not libraryLink then
@@ -192,10 +192,10 @@ do
192192
tmpName = tmpName:match("(.+)%..+$")
193193
end
194194

195-
libraryLink:write("return require(\"./" .. config()["libraryDirectory"]
195+
libraryLink.write("return require(\"./" .. config()["libraryDirectory"]
196196
.. tmpName .. config()[sourceObject.type .. "Suffix"]
197197
.. "/" .. tmpName .. "\")")
198-
libraryLink:close()
198+
libraryLink.close()
199199
end
200200

201201
return sourceObject, true

libs/scm/scriptManager.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,14 @@ do
136136
end
137137

138138
-- delete file
139-
if scriptType and fs.exists(config()[scriptType .. "Directory"] .. name .. ".lua") then
140-
fs.delete(config()[scriptType .. "Directory"] .. name .. config()[scriptType .. "Suffix"])
139+
local scriptDir = config()[scriptType .. "Directory"]
140+
if scriptType and (
141+
fs.exists(scriptDir .. name .. ".lua") or
142+
fs.exists(scriptDir .. name .. config()[scriptType .. "Suffix"])
143+
) then
144+
fs.delete(scriptDir .. name .. config()[scriptType .. "Suffix"])
141145
if scriptType == "library" then
142-
fs.delete(config()[scriptType .. "Directory"] .. name .. ".lua")
146+
fs.delete(scriptDir .. name .. ".lua")
143147
end
144148
end
145149

scm.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---@class SCM
22
SCM = {}
3-
require('libs.scm.config')
4-
require('libs.scm.net')
5-
require('libs.scm.log')
6-
require('libs.scm.scriptManager')
7-
require('libs.scm.autocomplete')
8-
require('libs.scm.ui')
3+
require('./libs.scm.config')
4+
require('./libs.scm.net')
5+
require('./libs.scm.log')
6+
require('./libs.scm.scriptManager')
7+
require('./libs.scm.autocomplete')
8+
require('./libs.scm.ui')
99

1010
function SCM:checkVersion()
1111
if not self.Config.config["updateAvailable"] and self.Config.config["lastVersionCheck"] ~= '' .. os.day("utc") then

0 commit comments

Comments
 (0)