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 { remote } = require('electron')
|
||||
const { app } = remote
|
||||
const os = require('os')
|
||||
|
||||
const themePath = process.env.NODE_ENV === 'production'
|
||||
? path.join(app.getAppPath(), './node_modules/codemirror/theme')
|
||||
@@ -18,8 +19,8 @@ const snippetFile = process.env.NODE_ENV === 'production'
|
||||
|
||||
function getAppData () {
|
||||
return process.env.APPDATA || (process.platform === 'darwin'
|
||||
? process.env.HOME + 'Library' + path.sep + 'Preferences'
|
||||
: require('os').homedir() + path.sep + '.config')
|
||||
? path.join(process.env.HOME, 'Library', 'Preferences')
|
||||
: path.join(os.homedir(), '.config'))
|
||||
}
|
||||
|
||||
const consts = {
|
||||
|
||||
@@ -4,7 +4,7 @@ const sander = require('sander')
|
||||
const os = require('os')
|
||||
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')
|
||||
|
||||
test.beforeEach((t) => {
|
||||
|
||||
@@ -5,7 +5,7 @@ const os = require('os')
|
||||
const path = require('path')
|
||||
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 newSnippet = {
|
||||
id: crypto.randomBytes(16).toString('hex'),
|
||||
|
||||
@@ -5,7 +5,7 @@ const os = require('os')
|
||||
const path = require('path')
|
||||
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 oldSnippet = {
|
||||
id: crypto.randomBytes(16).toString('hex'),
|
||||
|
||||
Reference in New Issue
Block a user