Skip to content

Commit 08b08ef

Browse files
committed
chore: debug
1 parent 1f7fd05 commit 08b08ef

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,13 @@ jobs:
129129
node-version: ${{ matrix.node-version }}
130130
cache: 'npm'
131131

132+
- uses: actions/download-artifact@v5
133+
with:
134+
name: build
135+
132136
- name: Fetch deps
133137
run: npm ci
134138

135-
- name: Build
136-
run: npm run build
137-
138139
- name: Run all tests
139140
if: matrix.os == 'ubuntu-24.04'
140141
run: npm run test

src/main/ts/ps.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ const LOOKUPS: Record<string, {
2626
}
2727
},
2828
pwsh: {
29-
cmd: 'powershell',
30-
args: ['-NoProfile', '-Command', 'Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId,CommandLine | ConvertTo-Json -Compress'],
29+
cmd: 'pwsh',
30+
args: ['-NoProfile', '-Command', '"Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId,CommandLine | ConvertTo-Json -Compress"'],
3131
parse(stdout: string) {
3232
let arr: any[] = []
3333
try {
3434
arr = JSON.parse(stdout)
3535
} catch {
3636
return []
3737
}
38+
console.log('debug win2025+ data', arr)
39+
3840
// Reshape into Ingrid-like objects for normalizeOutput
3941
return arr.map(p => ({
4042
ProcessId: [p.ProcessId],
@@ -45,7 +47,7 @@ const LOOKUPS: Record<string, {
4547
},
4648
}
4749

48-
const isBin = (f: string): boolean => {
50+
const isBin = (f: string): boolean => {
4951
if (f === '') return false
5052
if (!f.includes('/') && !f.includes('\\')) return true
5153
if (f.length > 3 && f[0] === '"')
@@ -125,12 +127,15 @@ const _lookup = ({
125127
const { promise, resolve, reject } = pFactory()
126128
const result: TPsLookupEntry[] = []
127129
const lookupFlow = IS_WIN ? (IS_WIN2025_PLUS ? 'pwsh' : 'wmic') : 'ps'
130+
console.log('debug win2025+', lookupFlow)
128131
const {
129132
parse,
130133
cmd,
131134
args
132135
} = LOOKUPS[lookupFlow]
133-
const callback: TSpawnCtx['callback'] = (err, {stdout}) => {
136+
const callback: TSpawnCtx['callback'] = (err, {stdout, stderr}) => {
137+
console.log('stdout=', stdout.slice(0, 2000))
138+
console.log('stderr=', stderr)
134139
if (err) {
135140
reject(err)
136141
cb(err)

0 commit comments

Comments
 (0)