Trash class

The trash workspace <root>/.trash, the sibling of .ocean and of the ticket folders that holds everything gg removed from a ticket.

Nothing gg deletes on behalf of the user is lost right away: a published ticket's repositories and its .code-workspace file are moved here, so a forgotten local change can still be recovered. Emptying the trash is the user's job.

Constructors

Trash()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createDirForTicket(Directory ticketDir) Directory
Creates <root>/.trash/<ticket> when it does not exist and returns it.
dirFor(String rootPath) Directory
Returns <root>/.trash for the workspace root rootPath.
dirForTicket(Directory ticketDir) Directory
Returns <root>/.trash/<ticket> for the ticket directory ticketDir.
moveFromOcean({required FileSystemEntity source, required String rootPath}) Future<String>
Moves source — a repository of the ocean — into <root>/.trash/.ocean/<org>/<repo>, keeping the path it had relative to <root>/.ocean. Returns the path it was moved to.
moveFromTicket({required FileSystemEntity source, required Directory ticketDir}) Future<String>
Moves source into the trash of the ticket ticketDir, keeping the path it had relative to the ticket (<org>/<repo>, <ticket>.code-workspace, …). Returns the path it was moved to.
moveTicketToTrash({required Directory ticketDir}) Future<Directory>
Moves the whole ticket folder ticketDir into the trash as one unit — repositories, ticket.json, .gg/, the .code-workspace file, everything — and returns the directory it was moved to (normally <root>/.trash/<ticket>).