fix: 🐛 修复 linux 无法启动镜像或录制服务以及修改自定义依赖目录的问题

This commit is contained in:
viarotel 2023-10-28 17:21:07 +08:00
parent ad529ca662
commit d8156437bc
4 changed files with 15 additions and 9 deletions

View File

@ -7,7 +7,7 @@ export default (mainWindow) => {
ipcMain.handle(
'show-open-dialog',
async (event, { preset = '', ...options } = {}) => {
async (_, { preset = '', ...options } = {}) => {
// console.log('options', options)
const res = await dialog
.showOpenDialog(options)
@ -33,17 +33,17 @@ export default (mainWindow) => {
},
)
ipcMain.handle('open-path', async (event, pathValue) => {
ipcMain.handle('open-path', async (_, pathValue) => {
return shell.openPath(pathValue)
})
ipcMain.handle('show-item-in-folder', async (event, filePath) => {
ipcMain.handle('show-item-in-folder', async (_, filePath) => {
return shell.showItemInFolder(filePath)
})
ipcMain.handle(
'show-save-dialog',
async (event, { filePath = '', ...options } = {}) => {
async (_, { filePath = '', ...options } = {}) => {
const res = await dialog
.showSaveDialog({
...options,

View File

@ -148,6 +148,8 @@ const watch = async (callback) => {
export default () => {
const binPath = appStore.get('common.adbPath') || adbPath
console.log('adb.binPath', binPath)
client = Adb.createClient({
bin: binPath,
})

View File

@ -7,8 +7,11 @@ const shell = async (command, { stdout, stderr } = {}) => {
const ADB = appStore.get('common.adbPath') || adbPath
const args = command.split(' ')
console.log('scrcpy.shell.spawnPath', spawnPath)
console.log('scrcpy.shell.ADB', ADB)
const scrcpyProcess = spawn(`"${spawnPath}"`, args, {
env: { ...process.env, ADB: `"${ADB}"` },
env: { ...process.env, ADB },
shell: true,
encoding: 'utf8',
})

View File

@ -195,7 +195,7 @@
</template>
<script>
import { debounce } from 'lodash-es'
import { cloneDeep, debounce } from 'lodash-es'
import LanguageSelect from './LanguageSelect/index.vue'
import { usePreferenceStore } from '@/store/index.js'
import LoadingIcon from '@/components/Device/ControlBar/LoadingIcon/index.vue'
@ -368,14 +368,15 @@ export default {
messageEl.close()
},
async handleSelect({ field }, { properties, filters } = {}) {
async handleSelect({ field }, options = {}) {
const { properties, filters } = cloneDeep(options)
try {
const defaultPath = this.preferenceData[field]
const files = await this.$electron.ipcRenderer.invoke(
'show-open-dialog',
{
properties,
filters,
properties: properties || [],
filters: filters || [],
...(defaultPath
? {
defaultPath,