Skip to content

Instantly share code, notes, and snippets.

@Jacob-Tate
Created September 7, 2021 20:10
Show Gist options
  • Save Jacob-Tate/24f98fa1d4d49146b82932e3ca237925 to your computer and use it in GitHub Desktop.
Save Jacob-Tate/24f98fa1d4d49146b82932e3ca237925 to your computer and use it in GitHub Desktop.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: PXT related installs ::
:: ::
:: Author: Jacob I. Tate <[email protected]> ::
:: Date: 09/07/2021 ::
:: Version: 1.0.0 ::
:: ::
:: Changelog ::
:: 1.0.0 ::
:: - Created the script ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
setlocal
setlocal enableDelayedExpansion
set interactive=1
echo %cmdcmdline% | "C:\Windows\System32\find.exe" /i "%~0" >nul
if not errorlevel 1 set interactive=0
:: Go to the root dir
pushd %~dp0
::::::::::::::::::::::::::::::::::::
:: CHECK IF THINKGS ARE INSTALLED ::
::::::::::::::::::::::::::::::::::::
:: Detect if npm is installed
WHERE npm >nul 2>nul
IF %ERRORLEVEL% NEQ 0 (
:: Not installed yet
powershell write-host -fore Red == ERROR ==
echo NPM was not detected as being in the path
echo If the software is installed and not in the path please correct this
echo Otherwise download from this link: https://nodejs.org/en/download/
exit /b -1
) else (
:: Already installed
powershell write-host -fore Green NPM installed!
)
::::::::::::::::::::::::::::::::::::
:: DOWNLOADS ::
::::::::::::::::::::::::::::::::::::
:: Download the pxt command line tool from node
npm install -g pxt
:: clone everything
git clone https://github.com/jacob-tate/pxt pxt
git clone https://github.com/jacob-tate/pxt-common-packages pxt-common-packages
git clone https://github.com/jacob-tate/pxt-arcade pxt-arcade
::::::::::::::::::::::::::::::::::::
:: PXT ::
::::::::::::::::::::::::::::::::::::
:: Go to pxt directory
pushd pxt
:: run the install for pxt
npm install
:: run the build script
npm run build
:: go back to the base directory
popd
::::::::::::::::::::::::::::::::::::
:: PXT-COMMON-PACKAGES ::
::::::::::::::::::::::::::::::::::::
:: go to the pxt-common-packages
pushd pxt-common-packages
:: run the install for pxt-common-packages
npm install
:: run the link scripts for pxt
npm link ../pxt
:: go back to the base directory
popd
::::::::::::::::::::::::::::::::::::
:: PXT-ARCADES ::
::::::::::::::::::::::::::::::::::::
:: go to the pxt-arcade
pushd pxt-arcade
:: run the install for pxt-arcade
npm install
:: run the link scripts for pxt
npm link ../pxt
:: run the link scripts for pxt-common-packages
npm link ../pxt-common-packages
:: go back to the base directory
popd
::::::::::::::::::::::::::::::::::::
:: CLEANUP ::
::::::::::::::::::::::::::::::::::::
:: Go back to whereever we were
popd
:: Pause if it was a double click
if _%interactive%_==_0_ pause
:: Exit the script cleanly
exit /b 0
:dirty_exit
:: Go back to the scripts dir
popd
:: Pause if it was a double click
if _%interactive%_==_0_ pause
:: Exit the script dirty
exit /b -1
@Jacob-Tate
Copy link
Author

Setup script for my project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment