Upload translation files to Transifex via publish command [MAILPOET-855]
This commit is contained in:
25
RoboFile.php
25
RoboFile.php
@ -104,10 +104,24 @@ class RoboFile extends \Robo\Tasks {
|
||||
);
|
||||
}
|
||||
|
||||
function pushpot() {
|
||||
return $this->collectionBuilder()
|
||||
->addCode(array($this, 'txinit'))
|
||||
->taskExec('tx push -s')
|
||||
->run();
|
||||
}
|
||||
|
||||
function packtranslations() {
|
||||
return $this->collectionBuilder()
|
||||
->addCode(array($this, 'txinit'))
|
||||
->taskExec('./tasks/pack_translations.sh')
|
||||
->run();
|
||||
}
|
||||
|
||||
function txinit() {
|
||||
// Define WP_TRANSIFEX_API_TOKEN env. variable
|
||||
$this->loadEnv();
|
||||
return $this->_exec('./tasks/pack_translations.sh');
|
||||
return $this->_exec('./tasks/transifex_init.sh');
|
||||
}
|
||||
|
||||
function testUnit($opts=['file' => null, 'xml' => false]) {
|
||||
@ -311,6 +325,15 @@ class RoboFile extends \Robo\Tasks {
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function publish($opts = ['force' => false]) {
|
||||
return $this->collectionBuilder()
|
||||
->addCode(array($this, 'pushpot'))
|
||||
->addCode(function () use ($opts) {
|
||||
return $this->svnPublish($opts);
|
||||
})
|
||||
->run();
|
||||
}
|
||||
|
||||
protected function loadEnv() {
|
||||
$dotenv = new Dotenv\Dotenv(__DIR__);
|
||||
$dotenv->load();
|
||||
|
Reference in New Issue
Block a user