projects
/
cc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
347cabd
)
Added download utility
author
Olav Bakke Svendsen
<mail@olavbs.no>
Tue, 10 Oct 2023 10:22:17 +0000
(12:22 +0200)
committer
Olav Bakke Svendsen
<mail@olavbs.no>
Tue, 10 Oct 2023 10:22:17 +0000
(12:22 +0200)
common/dl.lua
[new file with mode: 0644]
patch
|
blob
diff --git a/common/dl.lua
b/common/dl.lua
new file mode 100644
(file)
index 0000000..
718fdb0
--- /dev/null
+++ b/
common/dl.lua
@@ -0,0
+1,15
@@
+-- dl.lua
+-- download from git repo
+-- usage:
+-- dl path/to/file.lua - saves to file.lua
+
+local from = {...}
+if from[1] then
+ local url = "https://git.olavbs.no/?p=cc.git;a=blob_plain;f="..from[1]..";hb=HEAD"
+ local to = string.match(from[1], "([^/]-)$")
+ if not shell.run("wget "..url.." "..to) then
+ print("Couldn't download "..from[1])
+ end
+else
+ print("Nothing to download")
+end