Skip to content

Commit

Permalink
Updates to work on Windows system
Browse files Browse the repository at this point in the history
  • Loading branch information
hansek committed Oct 28, 2014
1 parent 2538f76 commit 9c13edb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bin/teleport.php
Expand Up @@ -42,7 +42,7 @@
try {
require_once __DIR__ . '/../src/bootstrap.php';

define('TELEPORT_BASE_PATH', rtrim(getcwd(), '/') . '/');
define('TELEPORT_BASE_PATH', rtrim(getcwd(), '/') . DIRECTORY_SEPARATOR);

$options = array(
'debug' => $debug
Expand Down
2 changes: 1 addition & 1 deletion src/Teleport/Action/Extract.php
Expand Up @@ -144,7 +144,7 @@ protected function createPackage($name, $version, $release = '')
$filename = $signature . '.transport.zip';

/* remove the package if it's already been made */
$directory = TELEPORT_BASE_PATH . 'workspace/';
$directory = TELEPORT_BASE_PATH . 'workspace' . DIRECTORY_SEPARATOR;
if (file_exists($directory . $filename)) {
unlink($directory . $filename);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Teleport/Action/Inject.php
Expand Up @@ -54,17 +54,17 @@ public function process()
$this->modx->loadClass('transport.xPDOFileVehicle', XPDO_CORE_PATH, true, true);

$transportName = basename($this->source);
if (TELEPORT_BASE_PATH . 'workspace/' . $transportName !== realpath($this->source)) {
if (!$this->pull($this->source, TELEPORT_BASE_PATH . 'workspace/' . $transportName)) {
if (TELEPORT_BASE_PATH . 'workspace' . DIRECTORY_SEPARATOR . $transportName !== realpath($this->source)) {
if (!$this->pull($this->source, TELEPORT_BASE_PATH . 'workspace' . DIRECTORY_SEPARATOR . $transportName)) {
throw new ActionException($this, "Error pulling {$this->source}");
}
} else {
$this->preserveWorkspace = true;
}

$this->package = Transport::retrieve($this->modx, TELEPORT_BASE_PATH . 'workspace/' . $transportName, TELEPORT_BASE_PATH . 'workspace/');
$this->package = Transport::retrieve($this->modx, TELEPORT_BASE_PATH . 'workspace' . DIRECTORY_SEPARATOR . $transportName, TELEPORT_BASE_PATH . 'workspace' . DIRECTORY_SEPARATOR);
if (!$this->package instanceof Transport) {
throw new ActionException($this, "Error extracting {$transportName} in workspace/");
throw new ActionException($this, "Error extracting {$transportName} in workspace" . DIRECTORY_SEPARATOR);
}

$this->package->preInstall();
Expand Down
2 changes: 1 addition & 1 deletion src/Teleport/Action/Profile.php
Expand Up @@ -68,7 +68,7 @@ public function process()
),
);

$profileFilename = TELEPORT_BASE_PATH . 'profile/' . $this->code . '.profile.json';
$profileFilename = TELEPORT_BASE_PATH . 'profile' . DIRECTORY_SEPARATOR . $this->code . '.profile.json';
$written = $this->modx->getCacheManager()->writeFile($profileFilename, $this->modx->toJSON($profile));

if ($written === false) {
Expand Down

0 comments on commit 9c13edb

Please sign in to comment.