this.new_sha = new_sha;
this.cur_sha = "";
this.update_cur_sha();
- print("New ResourcesItem %s (%s) => %s\n", target , this.cur_sha ,src);
+ print("New ResourcesItem %s (%s) => (%s) %s\n", target , this.cur_sha , new_sha, src);
}
public void update_cur_sha()
{
return;
}
uint8[] data;
+ uint8[] zero = { 0 };
GLib.FileUtils.get_data(tfn, out data);
var file = File.new_for_path (tfn);
"standard::*",
FileQueryInfoFlags.NONE
);
- var csdata = new GLib.ByteArray.take("blob %s\0".printf(info.get_size().to_string()).data);
+ var csdata = new GLib.ByteArray.take("blob %s".printf(info.get_size().to_string()).data);
+ csdata.append(zero);
csdata.append(data);
// git method... blob %d\0...string...
}
public Resources ()
{
+ this.initFiles();
+ }
+
+ public void initFiles()
+ {
string[] avail_files = {
"roodata.json",
"*",
src = "https://api.github.com/repos/roojs/app.Builder.js/contents/resources/" + split[0];
}
- this.fetch_files.add(new ResourcesItem(src,target));
+ this.fetch_files.add(new ResourcesItem(src,target, ""));
}
-
-
-
- }
-
+
+ }
int fetch_pos = 0;
public void fetchStart()
{
+ this.initFiles();
if (this.fetch_pos > 0) { // only fetch one at a time...
return;
}
for (var i = 0; i < this.fetch_files.size; i++ ) {
-
+ if (this.fetch_files.get(i).target.contains("*")) {
+ continue;
+ }
if (!FileUtils.test(
BuilderApplication.configDirectory() + "/resources/" + this.fetch_files.get(i).target,
FileTest.EXISTS