Skip to content

Commit

Permalink
fixed folder not opening by click on folder path url
Browse files Browse the repository at this point in the history
  • Loading branch information
RenanSui committed Aug 3, 2023
1 parent 246b1b0 commit b81d6cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
3 changes: 2 additions & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ appImage:
npmRebuild: false
publish:
provider: github
protocol: https
owner: renansui
repo: salvage
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "salvage",
"version": "1.3.0",
"version": "1.3.1",
"description": "Simple backup automator",
"main": "./out/main/index.js",
"author": "RenanSui",
Expand All @@ -9,13 +9,6 @@
"type": "git",
"url": "https://github.com/RenanSui/salvage.git"
},
"build": {
"publish": [{
"provider": "github",
"owner": "renansui",
"repo": "salvage"
}]
},
"scripts": {
"format": "prettier --write .",
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
Expand Down
13 changes: 6 additions & 7 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ app.whenReady().then(() => {
mainWindow.setMenu(null)

// check for updates
updateInterval = setInterval(() => autoUpdater.checkForUpdates(), 30)
updateInterval = setInterval(() => autoUpdater.checkForUpdates(), 600000)
})

app.on('browser-window-created', (_, window) => {
Expand Down Expand Up @@ -85,17 +85,16 @@ ipcMain.on('electron-store-set', async (_, key, val) => {
})

ipcMain.on('open-path', (_event, folderPath) => {
if (!fse.existsSync(folderPath)) {
fse.mkdirSync(folderPath, { recursive: true })
shell.openPath(path.join(folderPath))
}
const exist = !fse.existsSync(folderPath)

if (exist) fse.mkdirSync(folderPath, { recursive: true })

shell.openPath(path.join(folderPath))
})

ipcMain.on('watch-path', (_, srcDir) => {
if (fse.existsSync(srcDir) === true) {
watcher.add(srcDir)
// console.log('watching', srcDir)
// console.log('watching', path.join(srcDir))
}
})

Expand Down

0 comments on commit b81d6cb

Please sign in to comment.