fix: commit versioning
This commit is contained in:
parent
faebaa970a
commit
0028a86806
10
README.md
10
README.md
@ -1,4 +1,4 @@
|
|||||||

|

|
||||||
# Gcommit-cli
|
# Gcommit-cli
|
||||||
Git CLI Assistant is a command-line application (CLI) that facilitates the management of changes in Git repositories.
|
Git CLI Assistant is a command-line application (CLI) that facilitates the management of changes in Git repositories.
|
||||||
This tool provides an intuitive interface for performing common Git actions efficiently.
|
This tool provides an intuitive interface for performing common Git actions efficiently.
|
||||||
@ -27,7 +27,7 @@ Install the CLI globally
|
|||||||
## Usage
|
## Usage
|
||||||
In your console, just type:
|
In your console, just type:
|
||||||
```bash
|
```bash
|
||||||
:~$ gcommit-cli
|
:~$ gcommit
|
||||||
```
|
```
|
||||||
## Contribution
|
## Contribution
|
||||||
Contributions are welcome! If you find any bugs or have suggestions to improve this application, feel free to open an issue or send a pull request.
|
Contributions are welcome! If you find any bugs or have suggestions to improve this application, feel free to open an issue or send a pull request.
|
||||||
@ -36,8 +36,6 @@ Contributions are welcome! If you find any bugs or have suggestions to improve t
|
|||||||
This project is licensed under the MIT License. For more details, see the LICENSE file.
|
This project is licensed under the MIT License. For more details, see the LICENSE file.
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|
|
@ -11,6 +11,7 @@ esbuild.build({
|
|||||||
target: ['es2022'],
|
target: ['es2022'],
|
||||||
tsconfig: 'tsconfig.json',
|
tsconfig: 'tsconfig.json',
|
||||||
logLevel: 'debug',
|
logLevel: 'debug',
|
||||||
|
minify: true,
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
plugins: [
|
plugins: [
|
||||||
esbuildPluginClean({ patterns: 'dist/*' }),
|
esbuildPluginClean({ patterns: 'dist/*' }),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gcommit-cli",
|
"name": "gcommit-cli",
|
||||||
"version": "1.0.0",
|
"version": "0.0.1",
|
||||||
"description": "Git CLI Assistant is a command-line application (CLI)",
|
"description": "Git CLI Assistant is a command-line application (CLI)",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "cdairo22",
|
"name": "cdairo22",
|
||||||
@ -9,7 +9,7 @@
|
|||||||
"main": "dist/main.bundle.js",
|
"main": "dist/main.bundle.js",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"bin": {
|
"bin": {
|
||||||
"gcommit-cli": "node ./dist/main.bundle.js"
|
"gcommit": "node ./dist/main.bundle.js"
|
||||||
},
|
},
|
||||||
"preferGlobal": true,
|
"preferGlobal": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
@ -17,7 +17,7 @@
|
|||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/MrDiro/gcommit-cli.git"
|
"url": "https://github.com/MrDiro/GCommit-CLI.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node dist/main.bundle.js",
|
"start": "node dist/main.bundle.js",
|
||||||
|
@ -6,6 +6,7 @@ import { printTable } from 'console-table-printer';
|
|||||||
import versionConfig from './version.config.json';
|
import versionConfig from './version.config.json';
|
||||||
import { AppService } from "./app.service";
|
import { AppService } from "./app.service";
|
||||||
import { Component } from "modilitejs";
|
import { Component } from "modilitejs";
|
||||||
|
import path from 'node:path';
|
||||||
import { $ } from 'execa';
|
import { $ } from 'execa';
|
||||||
import wait from 'wait';
|
import wait from 'wait';
|
||||||
import ora from 'ora';
|
import ora from 'ora';
|
||||||
@ -104,7 +105,7 @@ export class AppComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async createGitRepository() {
|
private async createGitRepository() {
|
||||||
const pkgFile = './package.json';
|
const pkgFile = 'package.json';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.spinner.start('Analyzing repository ...');
|
this.spinner.start('Analyzing repository ...');
|
||||||
@ -132,22 +133,21 @@ export class AppComponent {
|
|||||||
this.spinner.start(bold('Creating git repository ...'));
|
this.spinner.start(bold('Creating git repository ...'));
|
||||||
await wait(600);
|
await wait(600);
|
||||||
|
|
||||||
if (!existsSync(pkgFile)) {
|
if (!existsSync(path.resolve(process.cwd(), pkgFile))) {
|
||||||
await $`npm init --init-version ${['0.0.0']} -y`;
|
await $`npm init --init-version ${['0.0.1']} -y`;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
await $`npm version ${['0.0.0']} --allow-same-version`;
|
await $`npm version ${['0.0.1']} --allow-same-version`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pkg = JSON.parse(
|
const pkg = JSON.parse(
|
||||||
readFileSync(pkgFile).toString()
|
readFileSync(path.resolve(process.cwd(), pkgFile)).toString()
|
||||||
);
|
);
|
||||||
|
|
||||||
this.createGitIgnoreFile();
|
this.createGitIgnoreFile();
|
||||||
await $`git init -b ${[branchName]}`;
|
await $`git init -b ${[branchName]}`;
|
||||||
await $`git add .`;
|
await $`git add .`;
|
||||||
await $`git commit -m ${[`"chore: first commit"`]} -m ${[`"First commit for the project ${pkg['name']}"`]}`
|
await $`git commit -m ${[`"chore: first commit (v0.0.1)"`]} -m ${[`"First commit for the project ${pkg['name']}"`]}`
|
||||||
await $`npm version ${['minor']}`;
|
|
||||||
|
|
||||||
this.spinner.succeed('Repository created.');
|
this.spinner.succeed('Repository created.');
|
||||||
|
|
||||||
@ -173,10 +173,10 @@ export class AppComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createGitIgnoreFile() {
|
private createGitIgnoreFile() {
|
||||||
const file = './gitignore';
|
const file = '.gitignore';
|
||||||
|
|
||||||
if (!existsSync(file)) {
|
if (!existsSync(path.resolve(process.cwd(), file))) {
|
||||||
writeFileSync(file, `
|
writeFileSync(path.resolve(process.cwd(), file), `
|
||||||
# Backup files created by text editors
|
# Backup files created by text editors
|
||||||
*~
|
*~
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user