• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kenhowardpdx / vscode-gist / 328

pending completion
328

push

travis-ci-com

web-flow
chore(deps): bump json5 from 2.2.0 to 2.2.3

Bumps [json5](https://github.com/json5/json5) from 2.2.0 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.0...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

158 of 235 branches covered (67.23%)

Branch coverage included in aggregate %.

580 of 644 relevant lines covered (90.06%)

3.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.32
/src/commands/gists/delete-file.ts
1
import { commands, window } from 'vscode';
1✔
2

3
import { GistCommands } from '../extension-commands';
1✔
4

5
const deleteFile: CommandInitializer = (
1✔
6
  _config: Configuration,
7
  services: Services,
8
  utils: Utils
9
): [Command, CommandFn] => {
10
  const { gists, logger } = services;
2✔
11

12
  const command = GistCommands.DeleteFile;
2✔
13

14
  const commandFn = async (): Promise<void> => {
2✔
15
    try {
2✔
16
      const editor = window.activeTextEditor;
2✔
17
      const doc: undefined | GistTextDocument = editor && editor.document;
2✔
18
      if (!doc) {
2!
19
        throw new Error('Document Missing');
×
20
      }
21
      const { id, filename } = utils.files.extractTextDocumentDetails(doc);
2✔
22
      if (id) {
2!
23
        const canDelete =
24
          (await utils.input.prompt('Enter "DELETE" to confirm')) === 'DELETE';
2✔
25
        if (!canDelete) {
2!
26
          logger.info('User Aborted Deletion');
×
27

28
          return;
×
29
        }
30
        logger.info(`Deleting File "${id}"`);
2✔
31
        // tslint:disable-next-line:no-null-keyword
32
        await gists.deleteFile(id, filename);
2✔
33
        commands.executeCommand('workbench.action.closeActiveEditor');
1✔
34
        utils.notify.info('Deleted File');
1✔
35
      } else {
36
        logger.info(`"${doc.fileName}" Not a Gist`);
×
37
        utils.notify.info('Document Is Not a Gist');
×
38
      }
39
    } catch (err) {
40
      const error: Error = err as Error;
1✔
41
      logger.error(`${command} > ${error && error.message}`);
1!
42
      utils.notify.error('Could Not Delete File', `Reason: ${error.message}`);
1✔
43
    }
44
  };
45

46
  return [command, commandFn];
2✔
47
};
48

49
export { deleteFile };
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc