try {
- var str = "%s\nMonitoring %d Directories";
+
var notification = new Notify.Notification(
"Git Live",
- str.vprintf(GitMonitor.gitlive, this.monitors.length),
+ "%s\nMonitoring %u Directories".printf(GitMonitor.gitlive, this.monitors.length),
"dialog-information"
);
string[] success = {};
string[] failure = {};
- var repos = new Array<GitRepo>(); //??
+ //var repos = new Array<GitRepo>(); //??
var done = new Array<GitMonitorQueue>();
// first build a array of repo's to work with
for(var i = 0; i < cmds.length; i++) {
+ var cmd = cmds.index(i);
var gitpath = cmd.gitpath;
- var ix = GitRepo.indexOf(this.repos, cmd.gitpath);
+ var ix = GitRepo.indexOf(repo_list, cmd.gitpath);
if (ix < 0) {
repo_list.append_val(new GitRepo( gitpath ));
- ix = GitRepo.indexOf(this.repos, cmd.gitpath);
+ ix = GitRepo.indexOf(repo_list, cmd.gitpath);
}
break;
case "rm":
- if (GitMonitorQueue.indexOfAdd(add_files, cmd.rm) > -1 ) {
+ if (GitMonitorQueue.indexOfAdd(add_files, cmd.vname) > -1 ) {
break;
}
// if file exists, do not try and delete it.
- if (FileUtils.test(cmd.rm, FileTest.EXISTS)) {
+ if (FileUtils.test(cmd.vname, FileTest.EXISTS)) {
break;
}
//repo.debug = 1;
// these can fail... at present... as we wildcard stuff.
- stdout.printf("ADD : %d files" , add_files.length);
+ stdout.printf("ADD : %u files" , add_files.length);
// make sure added files do not get removed..
var remove_files_f = new Array<GitMonitorQueue>();
for(var ii = 0;ii < remove_files.length;ii++) {
- if (GitMonitorQueue.indexOfAdd(add_files, remove_files.index(ii).rm) > -1 ) {
+ if (GitMonitorQueue.indexOfAdd(add_files, remove_files.index(ii).vname) > -1 ) {
continue;
}
remove_files_f.append_val(remove_files.index(ii));
};
- stdout.printf("REMOVE : %d files" , remove_files.length);
+ stdout.printf("REMOVE : %u files" , remove_files.length);
// make sure monitoring is paused so it does not recursively pick up
// deletions
// -- DO STUFF..
-
- repo.add(add_files);
- repo.remove(remove_files_f);
+ try {
+ repo.add(add_files);
+ } catch(Error e) {
+ failure += e.message;
+ }
+ try {
+ repo.remove(remove_files_f);
+ } catch(Error e) {
+ failure += e.message;
+ }
+
this.paused = false;
try {
// catch notification failures.. so we can carry on..
- if (success.length) {
+ if (success.length > 0) {
var notification = new Notify.Notification(
notification.show();
}
- if (failure.length) {
+ if (failure.length > 0) {
- var notification = new Notify.Notification({
+ var notification = new Notify.Notification(
summary: "Git Live ERROR!!",
string.joinv("\n",failure),
"dialog-information"
- });
+ );
notification.set_timeout(5); // show errros for longer
notification.show();