Skip to content

Commit

Permalink
add pull to “fetch” (#1276)
Browse files Browse the repository at this point in the history
* add fetch to “fetch”

* fetch => pull
  • Loading branch information
pq authored Dec 23, 2020
1 parent b9bc232 commit 427e70b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lua/core/norns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,20 @@ end

-- fetch (git clone)
norns.fetch = function(url)
local status = os.execute("cd "..paths.code.."; git clone "..url)
-- default to clone.
local command = "cd "..paths.code.."; git clone "..url

local parts = tab.split(url, "/")
local script = parts[#parts]
local checkout = paths.code.."/"..script

-- pull if already downloaded.
if (util.file_exists(checkout)) then
print(script.." already cloned; pulling instead...")
command = "cd "..checkout.."; git pull"
end

local status = os.execute(command)
if status then print("fetch: success. you may need to SYSTEM > RESET if the new project contains an engine")
else print("fetch: FAIL") end
end
Expand Down

0 comments on commit 427e70b

Please sign in to comment.