Skip to content

Commit

Permalink
Add command to sync src and wp while developing
Browse files Browse the repository at this point in the history
  • Loading branch information
Anderson Grudtner Martins committed Mar 10, 2017
1 parent e7d5bd4 commit 0ed1e0f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
20 changes: 20 additions & 0 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,26 @@ public function langWatch()
return $return;
}

/**
* Sync WP files with src files
*/
public function syncWp()
{
$return = $this->_exec('sh ./sync-wp.sh');

return $return;
}

/**
* Sync src files with WP files
*/
public function syncSrc()
{
$return = $this->_exec('sh ./sync-src.sh');

return $return;
}

public function packCleanup()
{
shell_exec('git clean -xdf ' . self::SOURCE_PATH);
Expand Down
8 changes: 8 additions & 0 deletions sync-src.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

# Sync the src folder into wordpress, to auto-update the code while
# developing. Used with fswatch in Mac OS to detect file changes.

# rsync -rtvu --delete ./src ~/Projects/OSTraining/Git/dev-env-wordpress/www/wp-content/plugins/embedpress
rm -rf ./src/*
cp -R ~/Projects/OSTraining/Git/dev-env-wordpress/www/wp-content/plugins/embedpress/* ./src/
8 changes: 8 additions & 0 deletions sync-wp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

# Sync the src folder into wordpress, to auto-update the code while
# developing. Used with fswatch in Mac OS to detect file changes.

# rsync -rtvu --delete ./src ~/Projects/OSTraining/Git/dev-env-wordpress/www/wp-content/plugins/embedpress
rm -rf ~/Projects/OSTraining/Git/dev-env-wordpress/www/wp-content/plugins/embedpress/*
cp -R ./src/* ~/Projects/OSTraining/Git/dev-env-wordpress/www/wp-content/plugins/embedpress/

0 comments on commit 0ed1e0f

Please sign in to comment.