Skip to content

Commit

Permalink
fix: ♻️ Fixed repeated dependency issues
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Dec 5, 2024
1 parent 7510548 commit 9777622
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 12 deletions.
9 changes: 4 additions & 5 deletions electron/configs/scrcpy/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { archResolve, extraResolve } from '$electron/helpers/index.js'
import { extraResolve } from '$electron/helpers/index.js'
import which from 'which'

export function getScrcpyPath() {
switch (process.platform) {
case 'win32':
return extraResolve(archResolve('win#{arch}/scrcpy/scrcpy.exe'))
return extraResolve('win/scrcpy/scrcpy.exe')
case 'darwin':
return extraResolve(archResolve('mac#{arch}/scrcpy/scrcpy'))
return extraResolve(`mac-${process.arch}/scrcpy/scrcpy`)
case 'linux':
return extraResolve(archResolve('linux#{arch}/scrcpy/scrcpy'))

return extraResolve('linux/scrcpy/scrcpy')
default:
return which.sync('scrcpy', { nothrow: true })
}
Expand Down
7 changes: 0 additions & 7 deletions electron/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,3 @@ export function loadPage(win, prefix = '') {
win.loadFile(join(process.env.DIST, prefix, 'index.html'))
}
}

export function archResolve(filePath = '', { template = '#{arch}', defaultArch = 'x64' } = {}) {
const arch = ![defaultArch].includes(process.arch) ? `-${process.arch}` : ''

const value = filePath.replaceAll(template, arch)
return value
}
File renamed without changes.

0 comments on commit 9777622

Please sign in to comment.