-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25b90c1
commit 7403aa1
Showing
20 changed files
with
533 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
'use strict' | ||
|
||
const { homedir } = require('os') | ||
const { join } = require('path') | ||
|
||
const { readJSON, writeJSON } = require('fs-extra') | ||
const pathExists = require('path-exists') | ||
|
||
const paths = { | ||
config: '.taskr.json', | ||
theming: '.taskr-theme.json' | ||
} | ||
|
||
for (const file in paths) { | ||
if (!{}.hasOwnProperty.call(paths, file)) { | ||
continue | ||
} | ||
|
||
paths[file] = join(homedir(), paths[file]) | ||
} | ||
|
||
const hasConfig = async () => { | ||
const configExists = await pathExists(paths.config) | ||
|
||
return configExists | ||
} | ||
|
||
const hasTheming = async () => { | ||
const themingExists = await pathExists(paths.theming) | ||
|
||
return themingExists | ||
} | ||
|
||
const createConfig = async () => { | ||
const cfg = { | ||
pro: false, | ||
lastUpdate: new Date() | ||
} | ||
|
||
await writeJSON(paths.config, cfg, { | ||
spaces: 2 | ||
}) | ||
} | ||
|
||
const createTheming = async () => { | ||
const theming = { | ||
white: '#ffffff', | ||
black: '#000000', | ||
romanSilver: '#868e96', | ||
darkMediumGray: '#aaaaaa', | ||
brightTurquoise: '00e7c0', | ||
fontSizeBase: '16px' | ||
} | ||
|
||
await writeJSON(paths.theming, theming, { | ||
spaces: 2 | ||
}) | ||
} | ||
|
||
exports.getConfig = async () => { | ||
if (!await hasConfig() && !await hasTheming()) { | ||
await createConfig() | ||
await createTheming() | ||
|
||
const user = await readJSON(paths.config) | ||
const theme = await readJSON(paths.theming) | ||
|
||
return { user, theme } | ||
} | ||
|
||
const user = await readJSON(paths.config) | ||
const theme = await readJSON(paths.theming) | ||
|
||
return { user, theme } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
'use strict' | ||
|
||
// Packages | ||
const { remote } = require('electron') | ||
|
||
const WinControls = () => { | ||
|
Oops, something went wrong.