Skip to content

Instantly share code, notes, and snippets.

@fables-tales
Created July 18, 2010 10:02
Show Gist options
  • Save fables-tales/480279 to your computer and use it in GitHub Desktop.
Save fables-tales/480279 to your computer and use it in GitHub Desktop.
diff --git a/include/errors.php b/include/errors.php
index 31da5b0..2a0ea41 100644
--- a/include/errors.php
+++ b/include/errors.php
@@ -7,3 +7,4 @@ define('E_PERM_DENIED', 4);
define('E_AUTH_FAILED', 5);
define('E_AUTH_DENIED', 6);
define('E_NOT_IMPL', 7);
+define('E_PROJ_NONEXISTANT', 0x21);
diff --git a/modules/proj.php b/modules/proj.php
index a6304d6..ae2368f 100644
--- a/modules/proj.php
+++ b/modules/proj.php
@@ -50,6 +50,7 @@ class ProjModule extends Module
$this->installCommand('new', array($this, 'createProject'));
$this->installCommand('info', array($this, 'projectInfo'));
$this->installCommand('log', array($this, 'projectLog'));
+ $this->installCommand('del', array($this, 'deleteProject'));
}
private function verifyTeam()
@@ -67,6 +68,26 @@ class ProjModule extends Module
$this->openProject($this->team, $this->projectName);
}
+ public function deleteProject()
+ {
+ $this->verifyTeam();
+ $projPath = $this->getRootRepoPath() . "/$this->team/$this->p
+ print(is_dir($projPath));
+ print("\n");
+ if (is_dir($projPath))
+ {
+ system("rm -rvf $projPath");
+ print(is_dir($projPath));
+ print("\n");
+ return TRUE;
+ }
+ else
+ {
+ throw new Exception("attempted to delete nonexistant
+ }
+
+ }
+
public function projectInfo()
{
$output = Output::getInstance();
diff --git a/tests/test-schedule b/tests/test-schedule
index 0c0275a..d197779 100644
--- a/tests/test-schedule
+++ b/tests/test-schedule
@@ -8,6 +8,7 @@ TEST auth/single
TEST proj/create
TEST proj/log
+TEST proj/del
TEST file/basic
TEST file/simulate/unimplemented
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment