Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
Try again
Browse files Browse the repository at this point in the history
  • Loading branch information
Anahkiasen committed Nov 12, 2014
1 parent 9e0e46b commit 86b22cc
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Rocketeer/Traits/BashModules/Filesystem.php
Expand Up @@ -29,7 +29,7 @@ trait Filesystem
*/
public function isSymlink($folder)
{
return $this->checkStatement('-L "'.$folder.'" && -d "'.$folder.'"');
return $this->checkStatement('-L "'.$folder.'" && -d "'.$folder.'"', true);
}

/**
Expand Down Expand Up @@ -230,14 +230,17 @@ public function removeFolder($folders = null)

/**
* Check a condition via Bash
*
* @param string $condition
*@param string $condition
* @param boolean $double
*
* @return boolean
*@return boolean
*/
protected function checkStatement($condition)
protected function checkStatement($condition, $double = false)
{
$condition = '[[ '.$condition.' ]] && echo "true"';
$condition = $double ? '[[ '.$condition.' ]]' : '[ '.$condition.' ]';
$condition .= '&& echo "true"';
$condition = $this->runRaw($condition);

return trim($condition) == 'true';
Expand Down

0 comments on commit 86b22cc

Please sign in to comment.