Skip to content

Commit 488f829

Browse files
authored
build: separate yarn and pnpm maintenance scripts (#1163)
1 parent b713f3c commit 488f829

6 files changed

+66
-57
lines changed

scripts/check-package-manager-pnpm.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# This script checks that the prerequisite
3+
# pnpm is installed
4+
5+
if ! command -v pnpm &> /dev/null
6+
then
7+
echo "**pnpm not installed**"
8+
echo "execute the following command:"
9+
echo "npm install pnpm -g"
10+
echo
11+
exit 1 # failure
12+
else
13+
echo "pnpm is installed"
14+
fi

scripts/check-package-manager-yarn.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# This script checks that the prerequisite
3+
# yarn is installed
4+
5+
if ! command -v yarn &> /dev/null
6+
then
7+
echo "**yarn not installed**"
8+
echo "execute the following command:"
9+
echo "npm install yarn -g"
10+
echo
11+
exit 1 # failure
12+
else
13+
echo "yarn is installed"
14+
fi

scripts/check-package-managers-other.sh

-32
This file was deleted.

scripts/update-cypress-latest-pnpm.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
set -e # fail on error
3+
#
4+
# Examples using the pnpm package manager are
5+
# updated to Cypress latest version
6+
#
7+
# Make sure that pnpm is installed
8+
./scripts/check-package-manager-pnpm.sh
9+
10+
echo updating pnpm examples to Cypress latest version
11+
cd examples
12+
13+
# examples/basic-pnpm (pnpm)
14+
echo
15+
echo updating examples/basic-pnpm to cypress@latest
16+
cd basic-pnpm
17+
pnpm add cypress@latest --save-dev --save-exact
18+
pnpm ls cypress
19+
cd ..
20+
21+
# examples/start-and-pnpm-workspaces
22+
echo
23+
echo updating pnpm workspaces example to Cypress latest version
24+
echo
25+
echo updating examples/start-and-pnpm-workspaces to cypress@latest
26+
cd start-and-pnpm-workspaces
27+
pnpm update cypress --latest --recursive
28+
pnpm ls cypress --recursive
29+
cd ..
30+
31+
cd ..

scripts/update-cypress-latest-other.sh scripts/update-cypress-latest-yarn.sh

+3-23
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22
set -e # fail on error
33
#
4-
# Examples using yarn and pnpm package managers are
4+
# Examples using the yarn package manager are
55
# updated to Cypress latest version
66
#
7-
# Make sure that pnpm and yarn are installed
8-
./scripts/check-package-managers-other.sh
7+
# Make sure that yarn is installed
8+
./scripts/check-package-manager-yarn.sh
99

1010
echo updating yarn examples to Cypress latest version
1111
cd examples
@@ -53,24 +53,4 @@ yarn set version latest
5353
yarn add cypress --dev --exact
5454
cd ..
5555

56-
# examples/basic-pnpm (pnpm)
57-
echo
58-
echo updating pnpm example to Cypress latest version
59-
echo
60-
echo updating examples/basic-pnpm to cypress@latest
61-
cd basic-pnpm
62-
pnpm add cypress@latest --save-dev --save-exact
63-
pnpm ls cypress
64-
cd ..
65-
66-
# examples/start-and-pnpm-workspaces
67-
echo
68-
echo updating pnpm workspaces example to Cypress latest version
69-
echo
70-
echo updating examples/start-and-pnpm-workspaces to cypress@latest
71-
cd start-and-pnpm-workspaces
72-
pnpm update cypress --latest --recursive
73-
pnpm ls cypress --recursive
74-
cd ..
75-
7656
cd ..

scripts/update-cypress-latest.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ set -e # fail on error
1111
#
1212
# First check if the required package managers are installed
1313
./scripts/check-package-manager-npm.sh
14-
./scripts/check-package-managers-other.sh
14+
./scripts/check-package-manager-yarn.sh
15+
./scripts/check-package-manager-pnpm.sh
1516
# then proceed to updating the examples
1617
echo
1718
./scripts/update-cypress-latest-npm.sh
18-
./scripts/update-cypress-latest-other.sh
19+
./scripts/update-cypress-latest-yarn.sh
20+
./scripts/update-cypress-latest-pnpm.sh
1921

2022
echo
2123
echo please manually edit run command in

0 commit comments

Comments
 (0)