Skip to content

Commit

Permalink
v1.3.4 - Fix: revsion file on server
Browse files Browse the repository at this point in the history
Signed-off-by: Baki Goxhaj <[email protected]>
  • Loading branch information
banago committed Mar 3, 2014
1 parent 52959dc commit 942159a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions phploy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author Bruno De Barros <[email protected]>
* @link http://wplancer.com
* @licence MIT Licence
* @version 1.3.3
* @version 1.3.4
*/

/**
Expand Down Expand Up @@ -497,14 +497,16 @@ class PHPloy
if (count($filesToUpload) > 0 or count($filesToDelete) > 0) {
$temp = tempnam(sys_get_temp_dir(), 'gitRevision');
$command = "git --git-dir='$this->repo/.git' --work-tree='$this->repo\' rev-parse HEAD";
exec(escapeshellcmd($command));
exec(escapeshellcmd($command), $locRev);

file_put_contents($temp, $loc_rev);
ftp_put($this->connection, $this->dotRevision, $temp, FTP_BINARY);

unlink($temp);
file_put_contents($temp, $locRev);

$this->output("+ ---------- ✓ ---------- +\r\n");
if (ftp_put($this->connection, $this->dotRevision, $temp, FTP_BINARY)) {
unlink($temp);
$this->output("+ ---------- ✓ ---------- +\r\n");
} else {
throw new Exception("Oh Snap: Could not update the revision file on server.");
}
} else {
$this->output("No files to upload.");
}
Expand Down

0 comments on commit 942159a

Please sign in to comment.