Skip to content

Improve Setup Scripts #1616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 18, 2016
Merged

Improve Setup Scripts #1616

merged 3 commits into from
Mar 18, 2016

Conversation

Mitko-Kerezov
Copy link
Contributor

Improve Setup Scripts:

Mac:

  • Asking permission from user for every installation - this includes an all option for eliminating subsequent questions
  • Improved error handling - warning upon non-zero exit code, error if the command execution fails
  • Adding -V option for sudo gem install cocoapods. This triggers a verbose output
  • Outputting multiple license acceptances for android tools
  • Creating ~/.cocoapods directory in case it does not exist

Windows:

  • Asking permission from user for every installation - this includes an all option for eliminating subsequent questions
  • Improved error handling - warning upon non-zero exit code
  • Initial check for latest .NET Framework installed - should be at least 4
  • Check for correct Chocolatey installation
  • Fixed the syntax in docs header on invoking the setup script from the command prompt
  • Added example syntax in docs header for invoking the setup script from powershell itself

Doctor command:

  • Upon detecting problems
    • Ask user whether to open up docs
    • Ask user whether to run setup script
  • Both questions have NO as default for non-interactive consoles and YES in interactive

Addresses some parts of NativeScript/NativeScript#1556

Ping @rosen-vladimirov and @teobugslayer

@Mitko-Kerezov Mitko-Kerezov self-assigned this Mar 17, 2016
@Mitko-Kerezov Mitko-Kerezov added this to the 1.7.1 milestone Mar 17, 2016
# To run it inside a COMMAND PROMPT against the production branch (only one supported with self-elevation) use
# @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1'))"
# To run it inside a WINDOWS POWERSHELL console against the production branch (only one supported with self-elevation) use
# start-process -FilePath PowerShell.exe -NoNewWindow -Wait -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1'))"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you are inside a powershell, why are you running another one? What about simply executing:

iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/NativeScript/nativescript-cli/production/setup/native-script.ps1'))

?

@Mitko-Kerezov Mitko-Kerezov force-pushed the kerezov/setup-scripts branch 2 times, most recently from 470d30d to 4297adf Compare March 18, 2016 08:15
@vchimev
Copy link

vchimev commented Mar 18, 2016

run ci

@Mitko-Kerezov Mitko-Kerezov force-pushed the kerezov/setup-scripts branch 4 times, most recently from 48c459c to 646ae0f Compare March 18, 2016 09:48
Changes include:
* Asking permission from user for every installation - this includes an `all` option for eliminating subsequent questions
* Improved error handling - warning upon non-zero exit code, error if the command execution fails
* Adding `-V` option for `sudo gem install cocoapods`. This triggers a verbose output
* Outputting multiple license acceptances for android tools
* Creating ~/.cocoapods directory in case it does not exist
@Mitko-Kerezov Mitko-Kerezov force-pushed the kerezov/setup-scripts branch from 646ae0f to 2882233 Compare March 18, 2016 09:49
@Mitko-Kerezov
Copy link
Contributor Author

Ping @teobugslayer with fixed comments

$latestDotNetVersion = $dotNetVersions.GetEnumerator() | Sort-Object Version | Select-Object -Last 1
$latestDotNetMajorNumber = $latestDotNetVersion.Version.Split(".")[0]
if ($latestDotNetMajorNumber -lt 4) {
Write-Host -ForegroundColor Red "Running this script requires at least a version 4.0 .NET framework installed"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Iva: "To run this script, you need .NET 4.0 or later installed"

@teobugslayer
Copy link
Contributor

Fix the messages, squash the commits and merge it! 👍 and excellent work!

Dimitar Kerezov added 2 commits March 18, 2016 13:54
Changes include:
    * Asking permission from user for every installation - this includes an `all` option for eliminating subsequent questions
    * Improved error handling - warning upon non-zero exit code
    * Initial check for latest .NET Framework installed - should be at least 4
    * Check for correct Chocolatey installation
    * Fixed the syntax in docs header on invoking the setup script from the command prompt
    * Added example syntax in docs header for invoking the setup script from powershell itself
If `$ tns doctor` detects any problems prompt the user to open docs and/or to run the setup script for his OS (if available).
Default answers to both questions set to NO for NON-interactive consoles automation purposes.
Default answers are set to YES for interactive consoles.
@Mitko-Kerezov Mitko-Kerezov force-pushed the kerezov/setup-scripts branch from 2882233 to ab2e132 Compare March 18, 2016 11:57
Mitko-Kerezov added a commit that referenced this pull request Mar 18, 2016
@Mitko-Kerezov Mitko-Kerezov merged commit 71e65f3 into release Mar 18, 2016
@Mitko-Kerezov Mitko-Kerezov deleted the kerezov/setup-scripts branch March 18, 2016 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants