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

Commit

Permalink
Bis
Browse files Browse the repository at this point in the history
  • Loading branch information
Anahkiasen committed Nov 12, 2014
1 parent 86b22cc commit 36e46f6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 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.'"', true);
return $this->checkStatement('-L "'.$folder.'"');
}

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

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

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

0 comments on commit 36e46f6

Please sign in to comment.