🔧 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:
Felix Rieseberg 2016-09-16 11:43:48 -07:00 committed by Kevin Sawicki
parent b05254807b
commit 90bff4d9de

View file

@ -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)
}
}
})