Skip to content

Commit 3ad68c1

Browse files
committed
copilot based on official examples
1 parent 8666956 commit 3ad68c1

File tree

2 files changed

+1662
-4121
lines changed

2 files changed

+1662
-4121
lines changed

copilot.sh

+28-9
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
11
#!/bin/bash
22

3-
# Define the directory containing the example files
4-
EXAMPLES_DIR="./"
53
# Define the output file
64
OUTPUT_FILE="copilot.txt"
75

86
# Clear the output file if it exists
97
> "$OUTPUT_FILE"
108

11-
# Generate a list of ignored files using git
12-
IGNORED_FILES=$(git ls-files --others --ignored --exclude-standard)
9+
# Add repository structure information at the beginning
10+
cat << 'EOF' > "$OUTPUT_FILE"
11+
# Repository structure
1312
14-
# Find all Python files, excluding those in .gitignore and community folder
15-
find . -name "*.py" ! -name "__init__.py" ! -path "./community/*" | grep -vFf <(echo "$IGNORED_FILES") | while read -r file; do
16-
# Append the file name to the output file
13+
A Restack backend application should be structured as follows:
14+
15+
- src/
16+
- client.py
17+
- functions/
18+
- __init__.py
19+
- function.py
20+
- workflows/
21+
- __init__.py
22+
- workflow.py
23+
- services.py
24+
- schedule_workflow.py
25+
- pyproject.toml
26+
- env.example
27+
- README.md
28+
- Dockerfile
29+
- restack_up.py
30+
31+
All these files are mandatory.
32+
33+
EOF
34+
35+
# Use git ls-files to get tracked files only, excluding .gitignore files
36+
git ls-files "*.py" | grep -v "__init__.py" | grep -v "community/" | while read -r file; do
37+
echo "Processing: $file" # Debug line
1738
echo "### File: $file ###" >> "$OUTPUT_FILE"
18-
# Append the content of the file to the output file
1939
cat "$file" >> "$OUTPUT_FILE"
20-
# Add a newline for separation
2140
echo -e "\n" >> "$OUTPUT_FILE"
2241
done
2342

0 commit comments

Comments
 (0)