|
|
@@ -1,12 +1,31 @@
|
|
|
-echo "clean node_modules"
|
|
|
-rm -r -force node_modules
|
|
|
-echo "clean angularlib node_modules"
|
|
|
-rm -r -force src/dependencies/angularlib/node_modules
|
|
|
-echo "clean dp-ui node_modules"
|
|
|
-rm -r -force src/dependencies/dp-ui/node_modules
|
|
|
-echo "clean npm cache"
|
|
|
-npm cache clean --force
|
|
|
-echo "clean ng cache"
|
|
|
-ng cache clean
|
|
|
-echo "install dependencies"
|
|
|
+function Load {
|
|
|
+ param([scriptblock]$function,
|
|
|
+ [string]$Label)
|
|
|
+ $job = Start-Job -ScriptBlock $function
|
|
|
+
|
|
|
+ $symbols = @("[-]", "[\]", "[|]", "[/]")
|
|
|
+ $i = 0;
|
|
|
+ while ($job.State -eq "Running") {
|
|
|
+ $symbol = $symbols[$i]
|
|
|
+ Write-Host -NoNewLine "`r$symbol $Label " -ForegroundColor Blue
|
|
|
+ Start-Sleep -Milliseconds 100
|
|
|
+ $i++
|
|
|
+ if ($i -eq $symbols.Count){
|
|
|
+ $i = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Write-Host "`r$Label finished" -ForegroundColor Green
|
|
|
+}
|
|
|
+function Delete {
|
|
|
+ param([string] $dir)
|
|
|
+ Write-Host "clean $dir" -ForegroundColor Blue;
|
|
|
+ if (test-path $dir) {rm -r -force $dir};
|
|
|
+ Write-Host "`r";
|
|
|
+ Write-Host "`rfinished cleaning $dir" -ForegroundColor Green;
|
|
|
+}
|
|
|
+Delete -dir "node_modules"
|
|
|
+Delete -dir "src/dependencies/angularlib/node_modules";
|
|
|
+Delete -dir "src/dependencies/dp-ui/node_modules";
|
|
|
+Load -function {npm cache clean --force} -label "clean npm cache";
|
|
|
+Load -function {ng cache clean} -label "clean ng cache";
|
|
|
npm i --legacy-peer-deps
|