Skip to content

Commit

Permalink
Fix an issue where hosts can not be selected when running for the fir…
Browse files Browse the repository at this point in the history
…st time.
  • Loading branch information
oldj committed Aug 19, 2019
1 parent 5a20740 commit 922a632
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion app/server/initWorkPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@

const fs = require('fs')
const path = require('path')
const makeId = require('../libs/make-id')
const version = require('../version')

module.exports = (work_path, sys_hosts_path) => {
fs.mkdirSync(work_path)
let is_dir = fs.existsSync(work_path) && fs.lstatSync(work_path).isDirectory()
if (!is_dir) {
fs.mkdirSync(work_path)
}

let cnt = fs.readFileSync(sys_hosts_path, 'utf-8')
let fn_data = path.join(work_path, 'data.json')
let data = {
list: [{
title: 'My hosts',
id: makeId(),
content: '# My hosts'
}, {
title: 'backup',
id: makeId(),
content: cnt
}],
version: version
Expand Down
2 changes: 1 addition & 1 deletion app/ui/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = [3, 5, 0, 5486]
module.exports = [3, 5, 0, 5487]

0 comments on commit 922a632

Please sign in to comment.