Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
move options file to ~/.nimble-options.json
Browse files Browse the repository at this point in the history
  • Loading branch information
soops committed Jul 19, 2016
1 parent 9004d83 commit 3e93e32
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 37 deletions.
1 change: 0 additions & 1 deletion clean-build.sh
Expand Up @@ -5,7 +5,6 @@ n 5.11.1
node -v
git pull
rm -rf node_modules/
rm -rf options.json
npm install
gulp build
n "$node_version"
22 changes: 4 additions & 18 deletions index.js
Expand Up @@ -7,24 +7,10 @@ var menubar = require('menubar');
var fs = require('fs');
var AutoLaunch = require('auto-launch');
var pjson = require('./package.json');
var os = require('os')

try {
global.options = require('./options.json') || {
"mathjs": true,
"startup": true,
"center": false,
"bugreport": true,
"autoupdate": true,
theme: {
"red": false,
"orange": true,
"yellow": false,
"green": false,
"blue": false,
"purple": false,
"pink": false,
"contrast": false
}
}
global.options = require(os.homedir() + '/.nimble-options.json');
} catch (e) {
global.options = {
"mathjs": true,
Expand Down Expand Up @@ -138,7 +124,7 @@ ipc.on('node_console', function(event, arg) {
});

ipc.on('save_options', function(event, arg) {
fs.writeFile(__dirname + "/options.json", arg, function(err) {
fs.writeFile(os.homedir() + '/.nimble-options.json', arg, function(err) {
if(err) {
console.log(err);
}
Expand Down
19 changes: 2 additions & 17 deletions src/index.html
Expand Up @@ -58,23 +58,8 @@
</script>
<script>
try {
window.options = require("../options.json") || {
"mathjs": true,
"startup": true,
"center": false,
"bugreport": true,
"autoupdate": true,
theme: {
"red": false,
"orange": true,
"yellow": false,
"green": false,
"blue": false,
"purple": false,
"pink": false,
"contrast": false
}
};
window.options = require(os.homedir() + '/.nimble-options.json');
console.log(require(os.homedir() + '/.nimble-options.json'))
} catch (e) {
window.options = {
"mathjs": true,
Expand Down
3 changes: 2 additions & 1 deletion src/js/script.js
Expand Up @@ -17,7 +17,8 @@ var $ = require('jquery'),
URL = "https://nimble-backend.herokuapp.com/input?i=%s",
unicode = /(?:\\:)(([a-z]|[0-9])+)/g,
imagesLoaded = require('imagesloaded'),
WebFrame = require('web-frame');
WebFrame = require('web-frame'),
os = require('os');

var clipboardCopy = {
link: function() {
Expand Down

0 comments on commit 3e93e32

Please sign in to comment.