Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fetching methods: http (curl) and git #1

Merged
merged 2 commits into from

2 participants

@miguel-negrao

No description provided.

@miguel-negrao

Added git checkout method also. Working here on my machine. If we add the language config path's stuff we should have a somewhat functional quarks2 system. :-)

@danstowell danstowell merged commit bb76ca5 into danstowell:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 22, 2012
  1. @miguel-negrao
  2. @miguel-negrao

    git method

    miguel-negrao authored
This page is out of date. Refresh to see the latest.
Showing with 23 additions and 3 deletions.
  1. +19 −1 Quarks2.sc
  2. +2 −1  example_quarks2.scd
  3. +2 −1  recommendedsources.yaml
View
20 Quarks2.sc
@@ -64,6 +64,7 @@ Quarks2 {
//this.fetch(quarkmeta["uri"], folderpath, quarkmeta["method"], quarkmeta["version"][quarkversion]["fetchInfo"])
"this.fetch(%, %, %, %)".format(quarkmeta["uri"], folderpath, quarkmeta["method"], quarkmeta["version"][quarkversion.asString]["fetchInfo"]).postln;
+ this.fetch(quarkmeta["uri"], folderpath, quarkmeta["method"], quarkmeta["version"][quarkversion.asString]["fetchInfo"])
}
// Adds a local quark to LanguageConfig, ensuring not a duplicate entry
@@ -89,7 +90,7 @@ Quarks2 {
*fetch { | uri, path, method, fetchInfo, singlefile=false |
// "fetchInfo" is extra information for retrieving that might not fit in the URI - for git sources, for example, it gives the TAG (if not present, assume it's the version#)
// If "path" already exists, this is an "update"-type operation. Otherwise it's a first-time.
- var firstTime = File.exists(path);
+ var firstTime = File.exists(path).not;
method = (method ?? { uri.split($:).at(0) }).asSymbol;
method.switch(
\file, {
@@ -101,6 +102,23 @@ Quarks2 {
File.mkdir(path.dirname);
File.copy(uri, path);
},
+ \http, {
+ uri.curl(path)
+ },
+ \git, {
+ var escapedPath = path.escapeChar($ );
+ if( firstTime) {
+ ("git clone "++uri++" "++escapedPath
+ ++ (fetchInfo !? { |tag|
+ (" && cd "++escapedPath++" && git checkout "++tag)
+ } ?? ""
+ ) ).postln.runInTerminal;
+ } {
+ (fetchInfo !? { |tag|
+ ("cd "++escapedPath++" && git checkout "++tag)
+ } ?? "").postln.runInTerminal;
+ }
+ },
{
Error("Unrecognised fetch method: %".format(method)).throw;
}
View
3  example_quarks2.scd
@@ -14,4 +14,5 @@ Quarks2.fetchQuark("cruciallib", "3.4", "0.2")
Quarks2.installQuark("cruciallib", "3.4", "0.2")
-
+//this should work
+Quarks2.getQuark("Modality", "3.5", "0.1")
View
3  recommendedsources.yaml
@@ -1,2 +1,3 @@
-homebake: file:///home/dan/.local/share/SuperCollider/Extensions/Quarks2/homebake.yaml
+homebake: file:///Users/miguelnegrao/Library/Application Support/SuperCollider/Extensions/Quarks2/homebake.yaml
+miguelnegrao: http://miguel-negrao.github.com/myquarks.yaml
Something went wrong with that request. Please try again.