-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedwoak.bash
61 lines (48 loc) · 1.26 KB
/
edwoak.bash
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
#!/bin/bash
# Meligo
alias start_api=".p && cd Meligo/tm8s-backend/tm8s && dotnet run --project tm8s.Plan.Api --launch-profile https"
alias watch_api=".p && cd Meligo/tm8s-backend/tm8s && dotnet watch --project tm8s.Plan.Api --launch-profile https"
# Dotnet EF
alias efdev="unset ASPNETCORE_ENVIRONMENT"
alias eftest="export ASPNETCORE_ENVIRONMENT=Test"
alias efstage="export ASPNETCORE_ENVIRONMENT=Staging"
efenv() {
eval "echo \"=> $ASPNETCORE_ENVIRONMENT"\"
}
STARTUP_PROJECT="tm8s.Plan.Api"
PROJECT="tm8s.Form.Infrastructure"
CONTEXT="FormDbContext"
ADDED_FLAGS=""
evalAddedFlags() {
export ADDED_FLAGS="--project $PROJECT --context $CONTEXT --startup-project $STARTUP_PROJECT"
}
efproject() {
if [[ -z "$1" ]]; then
echo "=> $PROJECT"
else
export PROJECT="tm8s.$1.Infrastructure"
fi
evalAddedFlags
}
efcontext() {
if [[ -z "$1" ]]; then
echo "=> $CONTEXT"
else
export CONTEXT="$1"
fi
evalAddedFlags
}
efaddmigrate() {
evalAddedFlags
eval "dotnet ef migrations add $1 $ADDED_FLAGS --json"
}
efremovemigrate() {
evalAddedFlags
echo "dotnet ef migrations remove $ADDED_FLAGS"
eval "dotnet ef migrations remove $ADDED_FLAGS"
}
efupdatemigrate() {
evalAddedFlags
eval "dotnet ef database update $1 $ADDED_FLAGS"
}
evalAddedFlags