File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
eng/pipelines/templates/steps Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,23 @@ parameters:
6
6
7
7
steps :
8
8
- script : |
9
+ RED='\033[0;31m'
10
+ exit_code=0
11
+ expected_npm_prefix=$(pwd)
12
+
9
13
# Log commands before running
10
14
set -x
11
15
12
- exit_code=0
13
-
14
16
pushd ${{parameters.Folder}}
15
17
18
+ actual_npm_prefix=$(npm prefix)
19
+
20
+ if [ "$expected_npm_prefix" != "$actual_npm_prefix" ]; then
21
+ echo -e "\n${RED}ERROR: TypeSpec folders MUST NOT contain a package.json, and instead MUST rely on the package.json at repo root."
22
+ echo -e "${RED}Expected npm prefix: $expected_npm_prefix\n${RED}Actual npm prefix: $actual_npm_prefix\n"
23
+ exit_code=1
24
+ fi
25
+
16
26
# Pass "--no" to ensure npx does not install anything (TypeSpec compiler should already be installed)
17
27
18
28
if test -f main.tsp; then
You can’t perform that action at this time.
0 commit comments