blob: 29484dd41a5ac76cff0af54ed8ff178b8a21e7cd (
plain) (
blame)
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
|
#!/bin/bash
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-?" ]; then
cat <<EOF
./delete-feature-template.sh [ProjectName] [FeatureName]
Example: ./delete-feature-template.sh CarShop Car
For more information: https://gitlab.com/Syndamia/it-kariera-exam-template#delete-feature-template
EOF
exit
fi
if [ -z "$1" ] || [ -z "$2" ]; then
echo "No name supplied!"
exit
fi
project_name="$1"
feature_name="$2"
# {{{ =============================>
# Remove from Data layer
dir="../$project_name/Data"
rm -f $dir/Models/$feature_name.cs
sed -i "/$feature_name/d" $dir/${project_name}Context.cs
# }}} =============================<
# {{{ =============================>
# Remove from Service layer
dir="../$project_name/Services"
rm -f $dir/Configurations/Service${feature_name}Mappings.cs
rm -rf $dir/Models/$feature_name
rm -f $dir/${feature_name}Service.cs
# }}} =============================<
# {{{ =============================>
# Remove from Web layer
dir="../$project_name/Web"
rm -f $dir/Configurations/Controller${feature_name}Mappings.cs
rm -f $dir/Controllers/${feature_name}Controller.cs
rm -rf $dir/Models/$feature_name
rm -rf $dir/Views/$feature_name
sed -i "/$feature_name/d" $dir/Views/_ViewImports.cshtml
sed -i "/$feature_name/d" $dir/Startup.cs
# }}} =============================<
|