Skip to content

Instantly share code, notes, and snippets.

@ansballard
Created March 7, 2017 05:57
Show Gist options
  • Save ansballard/917aad8fc9372f32646987d8177d4e0b to your computer and use it in GitHub Desktop.
Save ansballard/917aad8fc9372f32646987d8177d4e0b to your computer and use it in GitHub Desktop.
// ...
const { writeFile } = require("fs");
const { join } = require("path");
module.exports = {
// ...
activate() {
atom.config.observe("packagename.SettingName", updateStylesheet);
return this.subscriptions = new CompositeDisposable();
}
// ...
};
function updateStylesheet(value) {
writeFile(join(__dirname, "..", "styles", "custom.less"), `// AUTOGENERATED\n@SettingName: ${value};\n`, "utf8");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment