mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
removed path.sep and use path.join to concatenate path
This commit is contained in:
@@ -2,6 +2,7 @@ const path = require('path')
|
|||||||
const fs = require('sander')
|
const fs = require('sander')
|
||||||
const { remote } = require('electron')
|
const { remote } = require('electron')
|
||||||
const { app } = remote
|
const { app } = remote
|
||||||
|
const os = require('os')
|
||||||
|
|
||||||
const themePath = process.env.NODE_ENV === 'production'
|
const themePath = process.env.NODE_ENV === 'production'
|
||||||
? path.join(app.getAppPath(), './node_modules/codemirror/theme')
|
? path.join(app.getAppPath(), './node_modules/codemirror/theme')
|
||||||
@@ -18,8 +19,8 @@ const snippetFile = process.env.NODE_ENV === 'production'
|
|||||||
|
|
||||||
function getAppData () {
|
function getAppData () {
|
||||||
return process.env.APPDATA || (process.platform === 'darwin'
|
return process.env.APPDATA || (process.platform === 'darwin'
|
||||||
? process.env.HOME + 'Library' + path.sep + 'Preferences'
|
? path.join(process.env.HOME, 'Library', 'Preferences')
|
||||||
: require('os').homedir() + path.sep + '.config')
|
: path.join(os.homedir(), '.config'))
|
||||||
}
|
}
|
||||||
|
|
||||||
const consts = {
|
const consts = {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const sander = require('sander')
|
|||||||
const os = require('os')
|
const os = require('os')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
const snippetFilePath = path.join(os.tmpdir(), `test${path.sep}create-snippet`)
|
const snippetFilePath = path.join(os.tmpdir(), 'test', 'create-snippet')
|
||||||
const snippetFile = path.join(snippetFilePath, 'snippets.json')
|
const snippetFile = path.join(snippetFilePath, 'snippets.json')
|
||||||
|
|
||||||
test.beforeEach((t) => {
|
test.beforeEach((t) => {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const os = require('os')
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const crypto = require('crypto')
|
const crypto = require('crypto')
|
||||||
|
|
||||||
const snippetFilePath = path.join(os.tmpdir(), `test${path.sep}delete-snippet`)
|
const snippetFilePath = path.join(os.tmpdir(), 'test', 'delete-snippet')
|
||||||
const snippetFile = path.join(snippetFilePath, 'snippets.json')
|
const snippetFile = path.join(snippetFilePath, 'snippets.json')
|
||||||
const newSnippet = {
|
const newSnippet = {
|
||||||
id: crypto.randomBytes(16).toString('hex'),
|
id: crypto.randomBytes(16).toString('hex'),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const os = require('os')
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const crypto = require('crypto')
|
const crypto = require('crypto')
|
||||||
|
|
||||||
const snippetFilePath = path.join(os.tmpdir(), `test${path.sep}update-snippet`)
|
const snippetFilePath = path.join(os.tmpdir(), 'test', 'update-snippet')
|
||||||
const snippetFile = path.join(snippetFilePath, 'snippets.json')
|
const snippetFile = path.join(snippetFilePath, 'snippets.json')
|
||||||
const oldSnippet = {
|
const oldSnippet = {
|
||||||
id: crypto.randomBytes(16).toString('hex'),
|
id: crypto.randomBytes(16).toString('hex'),
|
||||||
|
|||||||
Reference in New Issue
Block a user