Skip to content

Commit

Permalink
fix: 🐛 Abnormal built-in terminal adb command
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Mar 10, 2024
1 parent bf2d2b4 commit 368551a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@ export function useAdb({ loading }) {
loading.value = true
const command = args.slice(1).join(' ')

const { stderr, stdout } = await $adb.shell(command || 'help')
let stderr
let stdout

try {
const res = await $adb.shell(command || 'help')

stdout = res?.stdout
stderr = res?.stderr
}
catch (error) {
stderr = error?.message || JSON.stringify(error) || 'Command failed'
}

if (stderr) {
return createStderr(stderr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import VueCommand, {
listFormatter,
} from 'vue-command'
import 'vue-command/dist/vue-command.css'
import { useAdb } from './composables/adb.js'
import { useAdb } from './composables/adb-async.js'
import { useScrcpy } from './composables/scrcpy.js'
import { useGnirehtet } from './composables/gnirehtet.js'
Expand Down

0 comments on commit 368551a

Please sign in to comment.