forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss.sh
More file actions
62 lines (40 loc) · 1.22 KB
/
Copy pathcss.sh
File metadata and controls
62 lines (40 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
source scripts/qa/lib/bash/prelude.sh
# Create the next app in /tmp
CSS_APP_PATH="/tmp/test-css-app"
echo "Creating next app in $CSS_APP_PATH"
echo ""
# Remove prev project and run create-next-app
rm -rf $CSS_APP_PATH
npx create-next-app $CSS_APP_PATH --ts --eslint --use-npm --no-tailwind --src-dir --app --import-alias="@/*"
# write to .env
echo "OPENAI_API_KEY=$OPENAI_API_KEY" > $CSS_APP_PATH/.env
npm_install_packages $CSS_APP_PATH
cp scripts/qa/lib/css/page.tsx $CSS_APP_PATH/src/app/page.tsx
# Open VSCode
code $CSS_APP_PATH
mkdir -p $CSS_APP_PATH/src/app/api/copilotkit/openai/
cp scripts/qa/lib/css/route.ts $CSS_APP_PATH/src/app/api/copilotkit/openai/route.ts
# Temporarily disable -e
set +e
pushd $CSS_APP_PATH
npm run build
exit_status=$?
if [ $exit_status -eq 0 ]; then
succeed "$pkg_manager build succeeded."
else
fail "$pkg_manager build failed with status $exit_status."
exit 1
fi
# Re-enable -e
set -e
npm run dev > /dev/null 2>&1 &
pid1=$!
popd
prompt "Open http://localhost:3000. Does it load with custom colors and icons?"
killall next-server;
succeed "Test completed successfully."
echo "===================="
echo "Test completed at $(date)"
echo "===================="
exit 0