Skip to content

Instantly share code, notes, and snippets.

@AGoblinKing
Created August 22, 2013 23:53
Show Gist options
  • Save AGoblinKing/6314126 to your computer and use it in GitHub Desktop.
Save AGoblinKing/6314126 to your computer and use it in GitHub Desktop.
define(function (require, exports, module) {
"use strict";
var DocumentManager = brackets.getModule("document/DocumentManager");
brackets.getModule("utils/AppInit").appReady(function () {
var p4 = require("p4");
$(DocumentManager)
.on("dirtyFlagChange", function (e, doc) {
var filePath = doc.file.fullPath;
console.log(doc, filePath);
p4.checkout(filePath).fail(p4.add(filePath));
})
.on("pathDeleted", function (e, path) {
p4.delete(path).fail(p4.revert(path));
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment