Try building a zip of the release
parent
cc900a16da
commit
5a908d6b61
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd ../
|
||||||
|
mkdir release-temp
|
||||||
|
TARGETDIR='release-temp';for file in *;do test "$file" != "$TARGETDIR" && cp -r "$file" "$TARGETDIR/";done
|
||||||
|
|
||||||
|
# Remove files that we don't want to bundle
|
||||||
|
cd release-temp
|
||||||
|
rm -rf ci
|
||||||
|
#rm .gitignore
|
||||||
|
#rm .gitlab-ci.yml
|
||||||
|
rm -rf .git
|
||||||
|
rm apidoc.json
|
||||||
|
rm CONTRIBUTING.md
|
||||||
|
|
||||||
|
cd ../
|
||||||
|
zip -r release.zip release-temp
|
||||||
|
rm -rf release-temp
|
@ -1,2 +1,49 @@
|
|||||||
<?php
|
<?php
|
||||||
var_dump(scandir('.'));
|
$zip_name = "release.zip";
|
||||||
|
|
||||||
|
if (!extension_loaded("zip")) {
|
||||||
|
die("Cannot zip file contents!");
|
||||||
|
}
|
||||||
|
|
||||||
|
$zip = new ZipArchive();
|
||||||
|
$res = $zip->open($zip_name, ZipArchive::CREATE);
|
||||||
|
if ($res !== true) {
|
||||||
|
die("Failed to create zip!\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create recursive directory iterator
|
||||||
|
/** @var SplFileInfo[] $files */
|
||||||
|
$files = new RecursiveIteratorIterator(
|
||||||
|
new RecursiveDirectoryIterator("../"),
|
||||||
|
RecursiveIteratorIterator::LEAVES_ONLY
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($files as $name => $file)
|
||||||
|
{
|
||||||
|
echo "\nWorking with file " . $file->getFilename() . "\n";
|
||||||
|
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (substr($file->getFilename(), 0, strlen($file->getFilename())) === "." ||
|
||||||
|
strtolower($file->getFilename()) === 'attachments' ||
|
||||||
|
strtolower($file->getFilename()) === "contributing.md" ||
|
||||||
|
strtolower($file->getFilename() === "ci") ||
|
||||||
|
strtolower($file->getFilename() === "apidoc.json")) {
|
||||||
|
//-- Don"t compress . files
|
||||||
|
echo "Skipped file.\n";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip directories (they would be added automatically)
|
||||||
|
if (!$file->isDir())
|
||||||
|
{
|
||||||
|
// Get real and relative path for current file
|
||||||
|
$filePath = $file->getRealPath();
|
||||||
|
$relativePath = substr($filePath, strlen("../") + 1);
|
||||||
|
|
||||||
|
// Add current file to archive
|
||||||
|
$zip->addFile($filePath, $relativePath);
|
||||||
|
} else {
|
||||||
|
echo "Skipped directory " . $file->getFilename() . "\n";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue