1
0
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:
Nguyễn Việt Hưng
2018-04-27 11:27:51 +07:00
parent 2e09501c8a
commit 8c43f3d567
4 changed files with 6 additions and 5 deletions

View File

@@ -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 = {

View File

@@ -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) => {

View File

@@ -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'),

View File

@@ -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'),