Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions e2e/utoo-pm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ if [ ! -d "ant-design-x" ]; then
git clone --branch next --single-branch https://github.com/ant-design/x.git ant-design-x
fi
cd ant-design-x
echo "Resolving dependencies for ant-design-x (next)..."
time utoo deps || { echo -e "${RED}FAIL: utoo deps failed for ant-design-x (next)${NC}"; exit 1; }
echo "Installing dependencies for ant-design-x (next)..."
utoo install --ignore-scripts || { echo -e "${RED}FAIL: utoo install failed for ant-design-x (next)${NC}"; exit 1; }
utoo rebuild || { echo -e "${RED}FAIL: utoo install failed for ant-design-x (next)${NC}"; exit 1; }
time utoo install --ignore-scripts || { echo -e "${RED}FAIL: utoo install failed for ant-design-x (next)${NC}"; exit 1; }
RUST_LOG=info utoo rebuild || { echo -e "${RED}FAIL: utoo rebuild failed for ant-design-x (next)${NC}"; exit 1; }
Comment on lines +26 to +30
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The project name string ant-design-x (next) is repeated in the echo statements and error messages. This is also the case for the ant-design test case. While this change doesn't introduce the pattern, it adds to it. For better maintainability, consider defining a variable for the project name at the beginning of each test case block and using it throughout. This would make the script easier to read and less prone to copy-paste errors.

echo -e "${GREEN}PASS: ant-design-x (next) cloned and installed${NC}"
cd ../../

Expand All @@ -37,8 +39,11 @@ if [ ! -d "ant-design" ]; then
fi
cd ant-design
rm -rf ~/.cache/nm
echo "Resolving dependencies for ant-design..."
time utoo deps || { echo -e "${RED}FAIL: utoo deps failed for ant-design${NC}"; exit 1; }
echo "Installing dependencies for ant-design..."
utoo install --ignore-scripts || { echo -e "${RED}FAIL: utoo install failed for ant-design${NC}"; exit 1; }
time utoo install --ignore-scripts || { echo -e "${RED}FAIL: utoo install failed for ant-design${NC}"; exit 1; }
RUST_LOG=info utoo rebuild || { echo -e "${RED}FAIL: utoo rebuild failed for ant-design${NC}"; exit 1; }
Comment on lines +42 to +46
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the ant-design-x test case, the project name ant-design is hardcoded in multiple places here. Extracting it into a variable would improve the script's maintainability and readability.

echo -e "${GREEN}PASS: ant-design cloned and installed${NC}"
cd ../../

Expand Down
Loading