Create a general solution for warnings before command execution
[?]
Jan 7, 2021, 1:46 AM
BOCCATU2STQRXDDXKEIEFYIHFONOJYZM457UEPBKD7HQPFYA75IACDependencies
- [2]
UBNZ7UMTAdd warning message to the resetAll command - [3]
5ISTB4TWAdd commands to copy the hash and message of changes in the log - [4]
6H4B4UJQAdd commands to open repo and global pijul configuration files - [5]
GNQD74OZAdd pijul.openChange command and text document provider for pijul-change scheme - [6]
VWRDBPJZAdd command and menu option for adding one or more files to the repository - [7]
L44OILGKAdd reset command to resource state context menu - [8]
MU6ZNUYZIntegrate recordAll command with input box - [9]
YDCLFNEJAdd menu command for recording changes to specific files - [*]
ILH3GIVTAdd command centre and refresh/init commands
Change contents
- replacement in src/commands.ts at line 198
await repository.reset(...resourceStates);if (await commandWarning(`Are you sure you want to reset ${resourceStates.length} file(s) to their last recorded state? Any changes will be lost forever.`)) {await repository.reset(...resourceStates);await repository.refreshStatus();} - replacement in src/commands.ts at line 210
const message = `Are you sure you want to reset ${this.repository.changedGroup.resourceStates.length} file(s) to their last recorded state? Any changes will be lost forever.`;const yes = 'Continue';const pick = await window.showWarningMessage(message, { modal: true }, yes);if (pick === yes) {if (await commandWarning(`Are you sure you want to reset ${this.repository.changedGroup.resourceStates.length} file(s) to their last recorded state? Any changes will be lost forever.`)) { - replacement in src/commands.ts at line 241
* @param change The change top open* @param change The change to open - edit in src/commands.ts at line 345[11.4046][11.4046]
}/*** Show a warning message to the user before executing a command.* @param message The message to display on the warning message.* @returns A boolean indicating if command execution should continue*/async function commandWarning (message: string): Promise<boolean> {const yes = 'Continue';const pick = await window.showWarningMessage(message, { modal: true }, yes);return pick === yes;