-
Notifications
You must be signed in to change notification settings - Fork 3
/
migrate.sh
executable file
·58 lines (46 loc) · 2.01 KB
/
migrate.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
#!/bin/sh
function migrateDotNetSources {
for f in $(find . -name '*Zuehlke.ExpenseReporting.csproj'); do
echo "Migrate $f";
sed -i '' -e 's/netcoreapp1\.1/netcoreapp2\.0/g' $f;
sed -i '' -e '/PackageTargetFallback/d' $f;
sed -i '' -e 's/Microsoft\.AspNetCore\" Version=\"1\.1\.1\"/Microsoft\.AspNetCore\" Version=\"2\.0\.0\"/g' $f;
sed -i '' -e 's/Microsoft\.AspNetCore\.Mvc\" Version=\"1\.1\.2\"/Microsoft\.AspNetCore\.Mvc\" Version=\"2\.0\.0\"/g' $f;
sed -i '' -e 's/Microsoft\.AspNetCore\.SpaServices\" Version=\"1\.1\.0\"/Microsoft\.AspNetCore\.SpaServices\" Version=\"2\.0\.0\"/g' $f;
sed -i '' -e 's/Microsoft\.AspNetCore\.StaticFiles\" Version=\"1\.1\.1\"/Microsoft\.AspNetCore\.StaticFiles\" Version=\"2\.0\.0\"/g' $f;
sed -i '' -e 's/Microsoft\.Extensions\.Configuration\.CommandLine\" Version=\"1\.1\.1\"/Microsoft\.Extensions\.Configuration\.CommandLine\" Version=\"2\.0\.0\"/g' $f;
sed -i '' -e 's/Microsoft\.Extensions\.Logging\.Debug\" Version=\"1\.1\.1\"/Microsoft\.Extensions\.Logging\.Debug\" Version=\"2\.0\.0\"/g' $f;
done
}
function migrateDotNetTests {
for f in $(find . -name '*Zuehlke.ExpenseReporting.Test.csproj'); do
echo "Migrate $f";
sed -i '' -e 's/netcoreapp1\.1/netcoreapp2\.0/g' $f;
done
}
function migrateGlobalJson {
for f in $(find . -name '*global.json'); do
echo "Migrate $f";
sed -i '' -e 's/\"version\": \"1\.1\.1\"/\"version\": \"2\.0\.0\"/g' $f;
done
}
function migratePackageJson {
for f in $(find . -name 'package.json'); do
# ignore files in any node_modules directory
if ! [[ $f == *"node_modules"* ]];
then
echo "Migrate $f";
sed -i '' -e 's/\"karma start karma.conf.js\"/\"karma start karma.conf.js --single-run\"/g' $f;
fi
done
}
function migrateLaunchJson {
for f in $(find . -name 'launch.json'); do
sed -i '' -e 's/Zuehlke\.ExpenseReporting\/bin\/Debug\/netcoreapp1\.1/Zuehlke\.ExpenseReporting\/bin\/Debug\/netcoreapp2\.0/g' $f;
done
}
#migrateDotNetSources
#migrateDotNetTests
#migrateGlobalJson
#migratePackageJson
migrateLaunchJson