Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Change the suffix position (#46, #47, #49) #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
We use [GitHub's Releases feature](https://github.com/blog/1547-release-your-software) for changelogs.

See [the Releases section of our GitHub project](https://github.com/mrmlnc/vscode-duplicate/releases) for changelogs for each release version of this plugin.
See [the Releases section of our GitHub project](https://github.com/trandaison/vscode-duplicate/releases) for changelogs for each release version of this plugin.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Please note that this project is released with a [Contributor Code of Conduct](C

There are a couple of ways you can contribute to this repo:

* **Ideas, feature requests and bugs**: We are open to all ideas and we want to get rid of bugs! Use the [Issues section](https://github.com/mrmlnc/vscode-duplicate/issues) to either report a new issue, provide your ideas or contribute to existing threads.
* **Ideas, feature requests and bugs**: We are open to all ideas and we want to get rid of bugs! Use the [Issues section](https://github.com/trandaison/vscode-duplicate/issues) to either report a new issue, provide your ideas or contribute to existing threads.
* **Documentation**: Found a typo or strangely worded sentences? Submit a PR!
* **Code**: Contribute bug fixes, features or design changes.

### Creating an Issue

Before you create a new Issue:

* Check the [Issues](https://github.com/mrmlnc/vscode-duplicate/issues) on Github to ensure one doesn't already exist.
* Check the [Issues](https://github.com/trandaison/vscode-duplicate/issues) on Github to ensure one doesn't already exist.
* Clearly describe the issue, including the steps to reproduce the issue.

### Making Changes
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
> This extension was forked from [mrmlnc/vscode-duplicate](https://github.com/mrmlnc/vscode-duplicate), it's a alternative version since the [mrmlnc/vscode-duplicate](https://github.com/mrmlnc/vscode-duplicate) is no longer being maintained for years.

# vscode-duplicate

> Ability to duplicate files and directories in VS Code.

## Donate

If you want to thank me, or promote your Issue.

[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/mrmlnc)

> Sorry, but I have work and support for plugins and modules requires some time after work. I will be glad of your support or PR's.

## Install

* Press <kbd>F1</kbd> and `select Extensions: Install Extensions`.
Expand Down
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "vscode-duplicate",
"name": "@trandaison/vscode-duplicate",
"displayName": "Duplicate action",
"description": "Ability to duplicate files in VS Code",
"version": "1.2.1",
"publisher": "mrmlnc",
"version": "2.0.0",
"publisher": "trandaison",
"license": "MIT",
"engines": {
"vscode": "^1.13.0"
},
"icon": "icon.png",
"homepage": "https://github.com/mrmlnc/vscode-duplicate/blob/master/README.md",
"homepage": "https://github.com/trandaison/vscode-duplicate/blob/master/README.md",
"repository": {
"type": "git",
"url": "https://github.com/mrmlnc/vscode-duplicate"
"url": "https://github.com/trandaison/vscode-duplicate"
},
"keywords": [
"duplicate",
Expand All @@ -23,9 +23,6 @@
"categories": [
"Other"
],
"activationEvents": [
"onCommand:duplicate.execute"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
Expand Down
5 changes: 3 additions & 2 deletions src/utils/prompt.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import * as vscode from 'vscode';

export function name(filename: string): Promise<string | undefined> {
const value = filename.replace(/(\.[^.]+)$/, '-copy.$1');
return vscode.window.showInputBox({
value,
placeHolder: 'Enter the new path for the duplicate.',
value: filename.split('.').map((el, i) => i === 0 ? `${el}-copy` : el).join('.')
}) as Promise<string | undefined>;
}

export function overwrite(filepath: string): Promise<vscode.MessageItem | undefined> {
const message = `The path **${filepath}** alredy exists. Do you want to overwrite the existing path?`;
const message = `The path **${filepath}** already exists. Do you want to overwrite the existing path?`;
const action = {
title: 'OK',
isCloseAffordance: false
Expand Down