Skip to content

Instantly share code, notes, and snippets.

@alfasado
Created March 24, 2014 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfasado/9734081 to your computer and use it in GitHub Desktop.
Save alfasado/9734081 to your computer and use it in GitHub Desktop.
name: Garbage Cleaner
id: GarbageCleaner
version: 0.1
callbacks:
MT::FileInfo::post_remove: >
sub {
my ( $cb, $obj ) = @_;
my $path = $obj->file_path;
require MT::FileMgr;
my $fmgr = MT::FileMgr->new( 'Local' )
or die MT::FileMgr->errstr;
if ( $fmgr->exists( $path ) ) {
$fmgr->delete( $path ) or die MT::FileMgr->errstr;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment