-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild
More file actions
executable file
·24 lines (21 loc) · 803 Bytes
/
build
File metadata and controls
executable file
·24 lines (21 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env php
<?php
// load module configuration
$config = realpath(dirname(__FILE__) . '/code/etc/config.xml');
$xml = simplexml_load_file($config);
// pull out name and version
foreach ($xml->modules[0] as $name => $info) {
$extension = $name;
$version = (string)$info->version;
}
// build extension
$projectPath = getcwd();
$buildPath = "/tmp/ash/{$extension}-{$version}";
$archiveName = strtolower("{$extension}-{$version}.zip");
$latestName = strtolower("{$extension}-latest.zip");
shell_exec('mkdir -p ' . $buildPath);
chdir($buildPath);
shell_exec('modman init && modman link --copy ' . $projectPath);
shell_exec("zip ~/Desktop/{$archiveName} -r ./* --exclude .modman");
shell_exec("cp ~/Desktop/{$archiveName} ~/Desktop/$latestName");
shell_exec('rm -rf ' . $buildPath);