🔧 Ensure correct types for commandLine
This commit ensures that arguments passed to `appendSwitch` and `appendArgument` are turned into strings before passing them over to the binding.
This commit is contained in:
parent
b05254807b
commit
90bff4d9de
1 changed files with 14 additions and 2 deletions
|
@ -24,8 +24,20 @@ Object.assign(app, {
|
|||
return Menu.getApplicationMenu()
|
||||
},
|
||||
commandLine: {
|
||||
appendSwitch: bindings.appendSwitch,
|
||||
appendArgument: bindings.appendArgument
|
||||
appendSwitch() {
|
||||
let castedArgs = [...arguments].map((arg) => {
|
||||
return typeof arg !== 'string' ? `${arg}` : arg
|
||||
})
|
||||
|
||||
return binding.appendSwitch(...castedArgs)
|
||||
},
|
||||
appendArgument() {
|
||||
let castedArgs = [...arguments].map((arg) => {
|
||||
return typeof arg !== 'string' ? `${arg}` : arg
|
||||
})
|
||||
|
||||
return binding.appendArgument(...castedArgs)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue