You've already forked dev-sidecar
mirror of
https://github.com/docmirror/dev-sidecar.git
synced 2025-11-26 14:10:40 +08:00
feat: 初步支持mac
This commit is contained in:
13
packages/core/test/macProxy.js
Normal file
13
packages/core/test/macProxy.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const childProcess = require('child_process')
|
||||
const util = require('util')
|
||||
const exec = util.promisify(childProcess.exec)
|
||||
|
||||
async function test () {
|
||||
const wifiAdaptor = (await exec('sh -c "networksetup -listnetworkserviceorder | grep `route -n get 0.0.0.0 | grep \'interface\' | cut -d \':\' -f2` -B 1 | head -n 1 | cut -d \' \' -f2"')).stdout.trim()
|
||||
|
||||
await exec(`networksetup -setwebproxystate '${wifiAdaptor}' off`)
|
||||
return await exec(`networksetup -setsecurewebproxystate '${wifiAdaptor}' off`)
|
||||
}
|
||||
test().then((ret) => {
|
||||
console.log('haha', ret)
|
||||
})
|
||||
Reference in New Issue
Block a user