You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plugins don't get all the needed information... #2
When using the hook; plugins don't know if the hook is being targeted at ios or android. I'm having to parse the command line myself to pull this info out even though the nativescript command should have that information.
In addition the platform folder imho should be pointing to the actual platform that is being targetted; not the ./platforms folder, as I then have to create the entire path to where the ios or android build data resides.
The second option is to use $devicesService.platform but it will NOT work for all the commands and all the hooks.
It will work only for device related commands (where device discovery is started) like tns run android, tns run ios, tns debug ios, tns debug anroid.
It will not work for device related commands when the platform is not provided - for example tns run.
It will not work for commands like tns preapre ios where device discovery is not started.
module.exports = function ($devicesService) {
const platform = $devicesService.platform;
}
Activity
farfromrefug commentedon Feb 2, 2019
@Fatme any news on this?
Facing this issue too
NathanaelA commentedon Feb 2, 2019
Fatme commentedon Feb 2, 2019
@farfromrefug,
The first option is to use
$options.argv._. It will return the full command line as array. After that you can search foriosorandroiditem.The second option is to use
$devicesService.platformbut it will NOT work for all the commands and all the hooks.It will work only for device related commands (where device discovery is started) like
tns run android,tns run ios,tns debug ios,tns debug anroid.It will not work for device related commands when the platform is not provided - for example
tns run.It will not work for commands like
tns preapre ioswhere device discovery is not started.farfromrefug commentedon Feb 2, 2019
@Fatme @NathanaelA thanks for the explanations! I think I ll use the command line args.
Fatme commentedon Feb 3, 2019
@farfromrefug,
The drawback of this approach is that it will not work when {N} CLI is used as library.
farfromrefug commentedon Feb 3, 2019
@Fatme when is it used as a library? sidekick?
Fatme commentedon Feb 3, 2019
@farfromrefug
Yes, sidekick