| 12345678910111213141516171819202122232425262728 |
- /**
- * @author oldj
- * @blog https://oldj.net
- */
- 'use strict'
- const fs = require('fs')
- const path = require('path')
- const version = require('../version')
- module.exports = (work_path, sys_hosts_path) => {
- 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',
- content: '# My hosts'
- }, {
- title: 'backup',
- content: cnt
- }],
- version: version
- }
- fs.writeFileSync(fn_data, JSON.stringify(data), 'utf-8')
- }
|