Skip to content

Commit 7e6050c

Browse files
author
Oscar Ortiz
committed
🐛 Fixed bug with yargs integration.
This error occurred after version 17.4.1 of yargs.
1 parent 39973b4 commit 7e6050c

7 files changed

Lines changed: 65 additions & 30 deletions

File tree

README.md

Lines changed: 60 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,68 @@
1-
# 🧑‍💻 Touch Win
2-
3-
> If you think that touch-win is a great project, consider making a small donation to be able to continue creating more projects like this. <a href="https://github.com/sponsors/zitrocode">GitHub Sponsor</a>.
1+
<br>
2+
<br>
3+
4+
<!-- Basic information -->
5+
<div align="center">
6+
<a href="github.com/zitrocode/touch-win">
7+
<img src="./images/touch-win-logo.png" alt="Touch Win Logo">
8+
</a>
9+
<!-- <h3>Touch Win</h3> -->
10+
<br>
11+
<p>
12+
A tool that will allow you to create multiple files using the terminal in Windows.
13+
</p>
14+
<div align="center">
15+
<a href="https://github.com/sponsors/zitrocode">
16+
<img alt="GitHub Sponsors" src="https://img.shields.io/github/sponsors/zitrocode?color=green&style=flat-square">
17+
</a>
18+
<a href="https://github.com/zitrocode/touch-win/network">
19+
<img alt="GitHub forks" src="https://img.shields.io/github/forks/zitrocode/touch-win?style=flat-square">
20+
</a>
21+
<a href="https://github.com/zitrocode/touch-win/stargazers">
22+
<img alt="GitHub stars" src="https://img.shields.io/github/stars/zitrocode/touch-win?style=flat-square">
23+
</a>
24+
<a href="https://github.com/zitrocode/touch-win/issues">
25+
<img alt="GitHub issues" src="https://img.shields.io/github/issues/zitrocode/touch-win?color=yellow&style=flat-square">
26+
</a>
27+
<a href="https://github.com/zitrocode/touch-win/blob/master/LICENSE">
28+
<img alt="GitHub license" src="https://img.shields.io/github/license/zitrocode/touch-win?style=flat-square">
29+
</a>
30+
<a href="https://www.linkedin.com/in/zitrocode">
31+
<img alt="npm" src="https://img.shields.io/npm/v/touch-win?style=flat-square">
32+
</a>
33+
</div>
34+
<br>
35+
<div align="center">
36+
<a href="https://github.com/zitrocode/touch-win/issues">
37+
<strong>Report Bug</strong>
38+
</a>
39+
·
40+
<a href="https://github.com/zitrocode/touch-win/issues">
41+
<strong>Request Feature</strong>
42+
</a>
43+
</div>
44+
</div>
445

546
---
647

7-
This project provides a simple and fast solution to create multiple files from a single command; Touch-win is inspired by the "touch" command found on Linux and UNIX based systems.
48+
<div align="center">
49+
<img src="./images/touch-win.jpg" width="90%">
50+
</div>
51+
<br>
852

9-
![image](./touch-win-screenshot.jpg)
53+
Touch win is a cli program that helps you create various files with a single command, it is inspired by the "touch" command found natively in Linux and Unix based operating systems. Even though there are several programs/packages in [npmjs](https://npmjs.com) that help you get this command on Windows, **I assure you that there is no one like it**.
1054

1155
## ✨ Features
1256

13-
- Allows you to create multiple files with a single command.
14-
- Automatically creates the necessary folders for the location of the file to create if it does not exist.
15-
- Allows you to create files from a base path.
16-
- Allows you to create files from a template.
17-
18-
<!-- ## ⚡️ Requirements -->
57+
- It allows you to generate multiple files with a single command.
58+
- Create folders automatically if they don't exist.
59+
- Allows you to generate files from a base path.
60+
- Allows you to generate files from a template.
1961

2062
## 📦 Installation
2163

2264
Install touch-win with your package manager:
2365

24-
#### NPM
25-
2666
```bash
2767
npm install -g touch-win
2868
```
@@ -37,23 +77,18 @@ touch-win --help
3777
Usage: touch-win [options] [file ...]
3878

3979
Options:
40-
--version Show version number [boolean]
41-
-h, --help Show help [boolean]
42-
-v, --verbose Run with verbose logging [boolean] [default: false]
43-
-b, --base Base folder to place the file(s) [string]
44-
-t, --template Template to generate files [string]
80+
--version Show version number [boolean]
81+
-h, --help Show help [boolean]
82+
-v, --verbose Run with verbose logging [boolean] [default: false]
83+
-b, --base Base folder to place the file(s) [string]
84+
-t, --template Template to generate files [string]
4585
Examples:
4686
touch-win [options] [file ...] Create file(s)
4787

4888
touch-win src/bin/cli.js src/helpers/file.js src/helpers/directory.js Standard use
49-
touch-win --base src/components/new_component Component.js Component.css Use with option "base"
50-
touch-win --template src/components/new_component/Component.[rf] js test.js css Use with option "template"
51-
touch-win --template config/webpack.[rf].js build dev common Use with option "template"
5289
```
5390

54-
### Base
55-
56-
This option allows you to create files from a base path, this will help you not to repeat the same path in each file.
91+
As you have seen, **Touch Win** has some options that will help you create a new file:
5792

5893
### Examples
5994

@@ -98,4 +133,4 @@ successfully created "config\webpack.common.js"
98133

99134
---
100135

101-
**⚠️ WARNING:** This package is still under development, so it may have some bugs.
136+
⚠️ **WARNING**: This package is still under development, so it may have some bugs.

images/touch-win-logo.png

2.9 KB
Loading

images/touch-win.jpg

24.2 KB
Loading

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const path = require("path");
44
const updateNotifier = require("update-notifier");
55
const pkg = require("./package.json");
66

7-
const argv = require("./src/bin/cli");
7+
const argv = require("./src/bin/cli").argv;
88
const createFile = require("./src/helpers/file");
99
const createDirectory = require("./src/helpers/directory");
1010
const alerts = require("./src/helpers/alerts");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "touch-win",
3-
"version": "0.6.1",
3+
"version": "0.6.2",
44
"description": "This package written in JavaScript allows you to use the Linux \"touch\" command on Windows.",
55
"bin": {
66
"touch-win": "./index.js"

src/bin/cli.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const yargs = require("yargs")
2+
const { hideBin } = require("yargs/helpers");
23

3-
yargs(process.argv.slice(2))
4+
yargs(hideBin(process.argv))
45
.usage("Usage: touch-win [options] [file ...]")
56
.example("touch-win [options] [file ...]", "Create file(s)")
67
.example("touch-win src/bin/cli.js src/helpers/file.js src/helpers/directory.js", "Standard use")
@@ -25,7 +26,6 @@ yargs(process.argv.slice(2))
2526
alias: "template",
2627
type: "string",
2728
describe: "Template to generate files"
28-
})
29-
.argv;
29+
});
3030

3131
module.exports = yargs;

touch-win-screenshot.jpg

-14 KB
Binary file not shown.

0 commit comments

Comments
 (0)