Skip to content

Commit

Permalink
fix: create .leptronrc if not exist when the setting title is clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
hackjutsu committed Jun 13, 2021
1 parent 4d64cfa commit 5d894cd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/containers/aboutPage/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fs from 'fs'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { Modal, Image } from 'react-bootstrap'
Expand All @@ -13,15 +14,19 @@ import launch from 'launch-editor'
import './index.scss'

const conf = remote.getGlobal('conf')
const logger = remote.getGlobal('logger')
const logFilePath = remote.getGlobal('logFilePath')
const configFilePath = remote.getGlobal('configFilePath')

class AboutPage extends Component {
openFileInEditor (filePath) {
if (!fs.existsSync(filePath)) {
fs.closeSync(fs.openSync(filePath, 'w'))
}
launch(
filePath,
(filePath, errorMsg) => {
console.log(errorMsg)
(filePath, error) => {
logger.error(`Failed to open ${filePath} with error ${error}`)
}
)
}
Expand Down

0 comments on commit 5d894cd

Please sign in to comment.