Skip to content

Commit

Permalink
Added a pull script which performs git revert, clean, and pull operat…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
binodnp committed Dec 4, 2016
1 parent edf5995 commit 1820b44
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pull.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
cd pull
pull.bat
pause
1 change: 1 addition & 0 deletions pull/env/GitDirectory.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:\Program Files\Git\bin
3 changes: 3 additions & 0 deletions pull/pull.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
powershell.exe -File pull.ps1
pause
45 changes: 45 additions & 0 deletions pull/pull.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
$currentDirectory = (Get-Item -Path ".\" -Verbose).FullName
$pathToRoot = (Get-Item -Path ".\" -Verbose).parent.FullName
$pathToAreas = "$pathToRoot\src\Frapid.Web\Areas";

function getGitDirectory(){
$gitDirectory = Get-Content "$currentDirectory\env\GitDirectory.txt";

return $gitDirectory;
};


function gitPull($path, $projectName){
cd $path;
$path;

"Reverting changes to $projectName";
git.exe checkout .

"Cleaning up $projectName";
git clean -n
git clean -f -d

"Pulling $projectName";
git.exe pull origin master
"`n"
};

cd $pathToRoot

$gitDirectory = getGitDirectory;
$env:Path = $gitDirectory;
$projectName = "Frapid";

gitPull $pathToRoot $projectName;

cd $pathToAreas
$areas = Get-ChildItem -dir

foreach($area in $areas){
$areaName = $area.Name;
$pathToProject = "$pathToAreas\$areaName";
gitPull $pathToProject $areaName;
};

cd

0 comments on commit 1820b44

Please sign in to comment.