forked from Codeception/codeception.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoboFile.php
More file actions
31 lines (29 loc) · 587 Bytes
/
Copy pathRoboFile.php
File metadata and controls
31 lines (29 loc) · 587 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
25
26
27
28
29
30
31
<?php
class Robofile
{
use Robo\Output;
use Robo\Task\FileSystem;
use Robo\Task\Git;
function post()
{
$title = $this->ask("Post title");
$file = strtolower(str_replace([' ',':'], ['-','-'], $title));
$date = date('Y-m-d');
$this->taskWriteToFile("_posts/$date-$file.markdown")
->line('---')
->line('layout: post')
->line("title: \"$title\"")
->line("date: $date 01:03:50")
->line("---\n")
->run();
}
function publish()
{
$this->taskGit()
->add('-A')
->commit('updated')
->pull()
->push()
->run();
}
}