-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_test
More file actions
executable file
·51 lines (41 loc) · 924 Bytes
/
Copy pathmake_test
File metadata and controls
executable file
·51 lines (41 loc) · 924 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# note(llm): Gemini 2.0 Flash
source_file="$1"
keyword="$2"
new_name="$3"
extension=".odl"
if [ -z "$source_file" ] || [ -z "$keyword" ] || [ -z "$new_name" ]; then
echo "Usage: $0 <source_file> <keyword> <new_name>"
exit 1
fi
if [ ! -f "$source_file" ]; then
echo "Error: Source file '$source_file' not found."
exit 1
fi
case "$keyword" in
error-syntax)
dest_dir="tests/errors/syntax"
;;
error-semantics)
dest_dir="tests/errors/semantics"
;;
feature)
dest_dir="tests/features"
;;
*)
echo "Error: Invalid keyword '$keyword'."
exit 1
;;
esac
if [ ! -d "$dest_dir" ]; then
mkdir -p "$dest_dir"
fi
dest_file="$dest_dir/$new_name$extension"
cp "$source_file" "$dest_file"
if [ $? -eq 0 ]; then
echo "File '$source_file' copied to '$dest_file' successfully."
else
echo "Error: Failed to copy file '$source_file' to '$dest_file'."
exit 1
fi
exit 0