Skip to content
Snippets Groups Projects
Commit 68a83b27 authored by Jared Hancock's avatar Jared Hancock
Browse files

Deploy dot files as well

parent c0c6ac50
No related branches found
No related tags found
No related merge requests found
...@@ -44,10 +44,12 @@ class Deployment extends Unpacker { ...@@ -44,10 +44,12 @@ class Deployment extends Unpacker {
$root = $this->find_root_folder(); $root = $this->find_root_folder();
# Unpack everything but the include/ folder # Unpack everything but the include/ folder
$this->unpackage("$root/*", $this->destination, -1, $this->unpackage("$root/{,.}*", $this->destination, -1,
array("$root/setup", "$root/include", "*.md", "*.txt")); array("$root/setup", "$root/include", "$root/.git*",
"*.sw[a-z]","*.md", "*.txt"));
# Unpack the include folder # Unpack the include folder
$this->unpackage("$root/include/*", $include, -1); $this->unpackage("$root/include/{,.}*", $include, -1,
array("*/include/ost-config.php"));
if (!$upgrade && $include != "{$this->destination}/include") if (!$upgrade && $include != "{$this->destination}/include")
$this->change_include_dir($include); $this->change_include_dir($include);
} }
......
...@@ -115,8 +115,11 @@ class Unpacker extends Module { ...@@ -115,8 +115,11 @@ class Unpacker extends Module {
} }
} }
if ($recurse) { if ($recurse) {
foreach (glob(dirname($folder).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) { foreach (glob(dirname($folder).'/'.basename($folder),
if ($this->exclude($exclude, $dir)) GLOB_BRACE|GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {
if (in_array(basename($dir), array('.','..')))
continue;
elseif ($this->exclude($exclude, $dir))
continue; continue;
$this->unpackage( $this->unpackage(
dirname($folder).'/'.basename($dir).'/'.basename($folder), dirname($folder).'/'.basename($dir).'/'.basename($folder),
...@@ -158,7 +161,7 @@ class Unpacker extends Module { ...@@ -158,7 +161,7 @@ class Unpacker extends Module {
# Get the current value of the INCLUDE_DIR before overwriting # Get the current value of the INCLUDE_DIR before overwriting
# main.inc.php # main.inc.php
$include = $this->get_include_dir(); $include = $this->get_include_dir();
$this->unpackage("$upload/*", $this->destination, -1, "*include"); $this->unpackage("$upload/{,.}*", $this->destination, -1, "*include");
if (!$upgrade) { if (!$upgrade) {
if ($this->getOption('include')) { if ($this->getOption('include')) {
...@@ -166,14 +169,14 @@ class Unpacker extends Module { ...@@ -166,14 +169,14 @@ class Unpacker extends Module {
if (!is_dir("$location/")) if (!is_dir("$location/"))
if (!mkdir("$location/", 0751, true)) if (!mkdir("$location/", 0751, true))
die("Unable to create folder for include/ files\n"); die("Unable to create folder for include/ files\n");
$this->unpackage("$upload/include/*", $location, -1); $this->unpackage("$upload/include/{,.}*", $location, -1);
$this->change_include_dir($location); $this->change_include_dir($location);
} }
else else
$this->unpackage("$upload/include/*", "{$this->destination}/include", -1); $this->unpackage("$upload/include/{,.}*", "{$this->destination}/include", -1);
} }
else { else {
$this->unpackage("$upload/include/*", $include, -1); $this->unpackage("$upload/include/{,.}*", $include, -1);
# Change the new main.inc.php to reflect the location of the # Change the new main.inc.php to reflect the location of the
# include/ directory # include/ directory
$this->change_include_dir($include); $this->change_include_dir($include);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment