-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·29 lines (21 loc) · 741 Bytes
/
Copy pathrun
File metadata and controls
executable file
·29 lines (21 loc) · 741 Bytes
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
#!/bin/bash
# Check if Puppeteer script exists
if [ ! -f "scrap.js" ]; then
echo "Puppeteer script not found! Please ensure leetcode-scraper.js exists."
exit 1
fi
# Check if Node.js script exists
if [ ! -f "leetcode.js" ]; then
echo "LeetCode CLI script not found! Please ensure leetcode-cli.js exists."
exit 1
fi
# Run the Puppeteer script in the background
nohup node scrap.js &
# Run the LeetCode CLI script
node leetcode.js
# Get the PID of the background process (for Puppeteer)
PID=$!
echo "LeetCode Scraper started in the background with PID: $PID"
echo "You can now continue with your work while the scraper runs."
# Optionally, you can check the logs
echo "To view the log of the scraper, check the nohup.out file."