Add command to delete channel

[?]
Jan 5, 2021, 9:55 PM
7DXA53YQGL4O53NUQOTRSDL4OROAJME6X37WZZMGST6TIBTXGG3AC

Dependencies

  • [2] LL5PNIAB Add command for switching to a given channel
  • [*] B4SKYP3Y Add repository model and add steps to initialize it
  • [*] 64J6B76F Add command to rename channels
  • [*] ZGMIJNFV Create pijul.ts for executing commands using the Pijul CLI
  • [*] ILH3GIVT Add command centre and refresh/init commands
  • [*] NCBEWRYE Initialize Repository
  • [*] 6H4B4UJQ Add commands to open repo and global pijul configuration files
  • [*] GNQD74OZ Add pijul.openChange command and text document provider for pijul-change scheme

Change contents

  • edit in src/repository.ts at line 288
    [2.406]
    [5.752]
    }
    /**
    * Delete a channel
    * @param targetChannel The channel that will be deleted
    */
    async deleteChannel (targetChannel: PijulChannel): Promise<void> {
    this.repository.deleteChannel(targetChannel);
  • edit in src/pijul.ts at line 365
    [2.694]
    [5.1095]
    }
    /**
    * Delete a channel
    * @param channel The channel that will be deleted
    */
    async deleteChannel (channel: PijulChannel): Promise<void> {
    await this._pijul.exec(this.repositoryRoot, ['channel', 'delete', channel.name]);
  • edit in src/commands.ts at line 289
    [2.1185]
    [5.1459]
    await repository.refreshStatus();
    }
    /**
    * Delete a channel
    * @param repository The repository that contains the channel
    */
    @command('pijul.deleteChannel', { repository: true })
    async deleteChannel (repository: Repository, targetChannel: PijulChannel): Promise<void> {
    if (targetChannel.isCurrent) {
    throw new Error('Cannot delete the current channel');
    }
    await repository.deleteChannel(targetChannel);
  • edit in package.json at line 117
    [5.1602]
    [9.1175]
    "command": "pijul.deleteChannel",
    "title": "Delete Channel",
    "category": "Pijul"
    },
    {
  • edit in package.json at line 301
    [2.1526]
    [10.1936]
    },
    {
    "command": "pijul.deleteChannel",
    "when": "view == pijul.views.channels && viewItem == pijulChannel"