ProzillaOS/docs/features/apps/terminal
Prozilla ac322e08e0
Migration to TypeScript - Stage 3
Added typescript linting
2024-05-07 23:46:02 +02:00
..
README.md Migration to TypeScript - Stage 3 2024-05-07 23:46:02 +02:00
screenshot.png Refactoring 2023-12-23 15:48:17 +01:00

← Back

Terminal ("Commands")

A command line tool.

Screenshot

Terminal window with neofetch command

Commands

See features/apps/terminal/commands for a list of commands. You can add files to this folder to add commands or edit existing files to modify commands.

Examples

Touch command

// features/apps/terminal/commands/touch.ts

export const touch = new Command()
	.setRequireArgs(true)
	.setManual({
		purpose: "Change file timestamps",
		usage: "touch [options] files",
		description: "Update the access and modification times of each FILE to the current time.\n\n"
			+ "A file argument that does not exist is created empty."
	})
	.setExecute(function(args, { currentDirectory }) {
		const { name, extension } = VirtualFile.convertId(args[0]);
	
		if (currentDirectory.findFile(name, extension))
			return { blank: true };
	
		currentDirectory.createFile(name, extension);
		return { blank: true };
	});