From c4dc16b13f6fa10df67c3cebd4213a9ae63f3d8f Mon Sep 17 00:00:00 2001 From: Collin Kleest Date: Mon, 26 Apr 2021 16:21:26 -0400 Subject: [PATCH] add quick install script and update readme --- README.md | 8 +++++++- wcfactoryme.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 wcfactoryme.sh diff --git a/README.md b/README.md index dde57cda2..7b1105905 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,12 @@ A factory that churns out web components, library agnostic with a unified develo [Here's a video showing what this is and how it works](https://www.youtube.com/playlist?list=PLJQupiji7J5cAv7Jfr1V8FvUTx_jJrmCl). -### Install +### Quick Install +```bash +curl -fsSL https://raw.githubusercontent.com/elmsln/WCFactory/master/wcfactoryme.sh -o wcfactoryme.sh && sh wcfactoryme.sh +``` + +### Manual Install Make sure you have a version of node v14.16.1 and above. Verify that you have yarn enabled — if not [install yarn](https://yarnpkg.com/lang/en/docs/install/) and ensure it is [globally available via PATH](https://yarnpkg.com/lang/en/docs/cli/global/). If using Linux, make sure you add `--prefix /usr/local` at the end of each of these calls @@ -26,6 +31,7 @@ $ yarn global add http-server ### Windows Install +Make sure a path entry to yarn global binaries is present or `wcf` will fail. Yarn global binaries can be found in `C:\Users\\AppData\Local\Yarn\bin` To properly configure git endlines for Windows, run this configuration ```bash $ git config --global core.autocrlf true diff --git a/wcfactoryme.sh b/wcfactoryme.sh new file mode 100644 index 000000000..b79bb4620 --- /dev/null +++ b/wcfactoryme.sh @@ -0,0 +1,40 @@ +#!/bin/bash +unameOut="$(uname -s)" +case "${unameOut}" in + Linux*) machine=Linux;; + Darwin*) machine=Mac;; + CYGWIN*) machine=Cygwin;; + MINGW*) machine=MinGw;; + *) machine="UNKNOWN:${unameOut}" +esac + +install () { + yarn global add symlink-dir + yarn global add @wcfactory/cli + yarn global add polymer-cli + yarn global add lerna + yarn global add web-component-analyzer + yarn global add http-server +} + +# make sure node is installed +if ! command -v node;then + echo "Install node and npm first then re-run script" + echo "Go to https://nodejs.org/en/download/ to download and install" + exit +fi + +# if yarn isn't installed install it +if ! command -v yarn;then + npm -g install yarn +fi + +if [ "${machine}" == "Cygwin" ]; then + git config --global core.autocrlf true + install +elif [ "${machine}" == "MinGw" ]; then + git config --global core.autocrlf true + install +else + install +fi \ No newline at end of file