2018-01-24 19:09:23 +00:00
|
|
|
#!/bin/bash
|
|
|
|
php -r '
|
|
|
|
echo "\n ..::Tainacan Theme::..\n";
|
2021-04-20 19:46:36 +00:00
|
|
|
echo "Copying files ...\n";
|
2021-04-25 03:53:19 +00:00
|
|
|
echo "Copying Bootstrap Framework ...\n";
|
2018-01-24 19:09:23 +00:00
|
|
|
|
2018-08-02 22:19:22 +00:00
|
|
|
if (!file_exists("src/assets/vendor/bootstrap")) {
|
|
|
|
mkdir("src/assets/vendor/", 0777, true);
|
|
|
|
mkdir("src/assets/vendor/bootstrap/", 0777, true);
|
|
|
|
mkdir("src/assets/vendor/bootstrap/scss", 0777, true);
|
|
|
|
mkdir("src/assets/vendor/bootstrap/js", 0777, true);
|
|
|
|
}
|
2018-01-26 16:48:42 +00:00
|
|
|
recurse_copy("vendor/twbs/bootstrap/scss", "src/assets/vendor/bootstrap/scss");
|
2018-12-21 19:21:17 +00:00
|
|
|
copy("vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js", "src/assets/vendor/bootstrap/js/bootstrap.min.js");
|
2018-10-01 18:05:11 +00:00
|
|
|
recurse_copy("vendor/twbs/bootstrap/js/src", "src/assets/vendor/bootstrap/js/src");
|
2018-01-26 16:48:42 +00:00
|
|
|
|
2021-04-25 03:53:19 +00:00
|
|
|
echo "Copying Slick Slider...\n";
|
2018-06-29 17:33:49 +00:00
|
|
|
if (!file_exists("src/assets/vendor/slick")) {
|
|
|
|
mkdir("src/assets/vendor/slick/", 0777, true);
|
2019-10-28 19:50:04 +00:00
|
|
|
mkdir("src/assets/vendor/slick/css", 0777, true);
|
2018-06-29 17:33:49 +00:00
|
|
|
mkdir("src/assets/vendor/slick/js", 0777, true);
|
2018-06-29 18:50:23 +00:00
|
|
|
mkdir("src/assets/vendor/slick/fonts", 0777, true);
|
2018-06-29 17:33:49 +00:00
|
|
|
}
|
2019-02-22 18:50:42 +00:00
|
|
|
recurse_copy("vendor/fabianobn/slick/slick/", "src/assets/vendor/slick/");
|
2018-08-10 20:11:32 +00:00
|
|
|
|
2021-04-25 03:53:19 +00:00
|
|
|
echo "Finished copying files! \n";
|
2018-01-24 19:09:23 +00:00
|
|
|
|
|
|
|
function recurse_copy($src,$dst) {
|
|
|
|
$dir = opendir($src);
|
|
|
|
@mkdir($dst);
|
|
|
|
while(false !== ( $file = readdir($dir)) ) {
|
|
|
|
if (( $file != "." ) && ( $file != ".." )) {
|
|
|
|
if ( is_dir($src . "/" . $file) ) {
|
|
|
|
recurse_copy($src . "/" . $file,$dst . "/" . $file);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
copy($src . "/" . $file,$dst . "/" . $file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
closedir($dir);
|
|
|
|
}
|
2018-12-21 19:21:17 +00:00
|
|
|
|
|
|
|
function delete_files($target) {
|
|
|
|
if(is_dir($target)){
|
|
|
|
$files = glob( $target . "*", GLOB_MARK ); //GLOB_MARK adds a slash to directories returned
|
|
|
|
|
|
|
|
foreach( $files as $file ){
|
2021-04-20 19:46:36 +00:00
|
|
|
delete_files( $file );
|
2018-12-21 19:21:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rmdir( $target );
|
|
|
|
} elseif(is_file($target)) {
|
2021-04-20 19:46:36 +00:00
|
|
|
unlink( $target );
|
2018-12-21 19:21:17 +00:00
|
|
|
}
|
|
|
|
}
|
2018-01-24 19:09:23 +00:00
|
|
|
'
|