-
-
Save VelinGeorgiev/5c22c3b89ab00225b5c67e3670db4b0e to your computer and use it in GitHub Desktop.
Bash script to create a set of SharePoint Framework projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
#set -o xtrace | |
version=$1 | |
cmd_base='yo @microsoft/sharepoint --solutionName spfx --component-name HelloWorld --component-description HelloWorld --skip-install' | |
cmd_v1_1="$cmd_base --no-skip-feature-deployment" | |
cmd_v1_3="$cmd_v1_1 --environment spo" | |
cmd_v1_7="$cmd_v1_3 --no-is-domain-isolated" | |
cmd="$cmd_v1_7" | |
if [ -z "$1" ]; then | |
echo "Specify the SharePoint Framework number to create projects for, eg. '151'" | |
exit 1 | |
fi | |
# spfx-$1-applicationcustomizer | |
echo "Creating application customizer..." | |
mkdir spfx-$1-applicationcustomizer && cd $_ | |
$cmd --component-type extension --extensionType ApplicationCustomizer | |
echo "DONE" | |
cd .. | |
# spfx-$1-fieldcustomizer-react | |
echo "Creating field customizer react..." | |
mkdir spfx-$1-fieldcustomizer-react && cd $_ | |
$cmd --component-type extension --extensionType FieldCustomizer --framework react | |
echo "DONE" | |
cd .. | |
# spfx-$1-listviewcommandset | |
echo "Creating list view command set..." | |
mkdir spfx-$1-listviewcommandset && cd $_ | |
$cmd --component-type extension --extensionType ListViewCommandSet | |
echo "DONE" | |
cd .. | |
# spfx-$1-webpart-ko | |
echo "Creating Knockout web part..." | |
mkdir spfx-$1-webpart-ko && cd $_ | |
$cmd --component-type webpart --framework knockout | |
echo "DONE" | |
cd .. | |
# spfx-$1-webpart-nolib | |
echo "Creating no library web part..." | |
mkdir spfx-$1-webpart-nolib && cd $_ | |
$cmd --component-type webpart --framework none | |
echo "DONE" | |
cd .. | |
# spfx-$1-webpart-react | |
echo "Creating React web part..." | |
mkdir spfx-$1-webpart-react && cd $_ | |
$cmd --component-type webpart --framework react | |
echo "DONE" | |
cd .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment