Skip to content

Instantly share code, notes, and snippets.

@sbruchmann
Last active August 29, 2015 14:03
Show Gist options
  • Save sbruchmann/ba1c060847b7def0630d to your computer and use it in GitHub Desktop.
Save sbruchmann/ba1c060847b7def0630d to your computer and use it in GitHub Desktop.
Writing files in Brackets extensions
define(function () {
"use strict";
var AppInit = brackets.getModule("utils/AppInit"),
FileSystem = brackets.getModule("filesystem/FileSystem"),
ProjectManager = brackets.getModule("project/ProjectManager");
AppInit.appReady(function () {
var filename = ProjectManager.getProjectRoot().fullPath + "hello-world.txt";
FileSystem.getFileForPath(filename).write("Hello world!\n");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment