-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
executable file
·62 lines (54 loc) · 1.63 KB
/
setup.sh
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
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
# Check if we're in the correct directory (has package.json)
if [ ! -f "package.json" ]; then
echo -e "${RED}Error: package.json not found. Are you in the correct directory?${NC}"
exit 1
fi
# Function to create directory if it doesn't exist
create_dir() {
if [ ! -d "$1" ]; then
mkdir -p "$1"
echo -e "${GREEN}Created directory: $1${NC}"
else
echo "Directory already exists: $1"
fi
}
# Function to create file if it doesn't exist
create_file() {
if [ ! -f "$1" ]; then
touch "$1"
# Add basic export statement to TypeScript files
if [[ $1 == *.ts ]]; then
echo "// $1" > "$1"
echo "export {}" >> "$1"
fi
echo -e "${GREEN}Created file: $1${NC}"
else
echo "File already exists: $1"
fi
}
# Create directory structure
create_dir "src/connectors"
create_dir "src/types"
create_dir "src/utils"
# Create files
create_file "src/connectors/binance-rest.ts"
create_file "src/connectors/binance-ws.ts"
create_file "src/types/market-data.ts"
create_file "src/types/api-types.ts"
create_file "src/utils/logger.ts"
create_file "src/config.ts"
echo -e "\n${GREEN}Directory structure created successfully!${NC}"
echo -e "Next steps:"
echo "1. Implement the TypeScript interfaces in types/"
echo "2. Set up the configuration in config.ts"
echo "3. Implement the connectors in connectors/"
echo "4. Set up logging in utils/logger.ts"
echo "5. Update main server implementation in index.ts"
# Print final directory tree
echo -e "\nFinal directory structure:"
tree