Skip to content

Commit 6fc9460

Browse files
authored
release v1.1.2
PR merge for release v1.1.2 new features and bug fixes
2 parents 4e57d71 + d4382c0 commit 6fc9460

File tree

1,725 files changed

+12369
-915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,725 files changed

+12369
-915
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
node_modules/
44
package-lock.json
55
database/*
6+
tests/
67
*.swp

API/addRepoApi.js

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,72 @@ function getEnvData() {
1818
};
1919
}
2020

21-
async function addRepoHandler(repoName, repoPath, initCheck) {
21+
async function addRepoHandler(
22+
repoName,
23+
repoPath,
24+
initCheck,
25+
cloneCheck,
26+
cloneUrl
27+
) {
2228
const timeStamp = new Date().toUTCString();
2329
const id = new Date().getTime();
2430

25-
var repoObject = {
26-
id,
27-
timeStamp,
28-
repoName,
29-
repoPath,
30-
};
31-
3231
function errorResponse() {
3332
return {
34-
addRepo: {
35-
message: "REPO_WRITE_FAILED",
36-
},
33+
message: "REPO_WRITE_FAILED",
3734
};
3835
}
3936

4037
function successResponse() {
4138
return {
42-
addRepo: {
43-
message: "REPO_DATA_UPDATED",
44-
repoId: id,
45-
},
39+
message: "REPO_DATA_UPDATED",
40+
repoId: id,
4641
};
4742
}
4843

44+
if (cloneCheck) {
45+
const cloneStatus = await execPromisified(
46+
`git clone "${cloneUrl}" "./${repoName}"`,
47+
{
48+
cwd: repoPath,
49+
windowsHide: true,
50+
}
51+
)
52+
.then(({ stdout, stderr }) => {
53+
console.log(stdout);
54+
console.log(stderr);
55+
if (stdout || stderr) {
56+
console.log(stdout);
57+
return true;
58+
} else {
59+
return false;
60+
}
61+
})
62+
.catch((err) => {
63+
console.log(err);
64+
return false;
65+
});
66+
67+
console.log("CLONE STAT : ", cloneStatus);
68+
69+
if (cloneStatus) {
70+
if (repoPath.includes("\\")) {
71+
repoPath = repoPath + "\\" + repoName;
72+
} else {
73+
repoPath = repoPath + "/" + repoName;
74+
}
75+
} else {
76+
return errorResponse();
77+
}
78+
}
79+
80+
const repoObject = {
81+
id,
82+
timeStamp,
83+
repoName,
84+
repoPath,
85+
};
86+
4987
const dataStoreFile = getEnvData().DATABASE_FILE;
5088

5189
let fileData = fs.readFileSync(dataStoreFile);

API/deleteRepoApi.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ async function deleteRepoApi(repoId) {
2424
const fileContent = JSON.parse(data.toString());
2525

2626
if (fileContent && fileContent.length > 0) {
27-
let updatedData = fileContent.filter(({ id, repoName, repoPath }) => {
27+
let updatedData = fileContent.filter(({ id }) => {
2828
if (id.toString() === repoId.toString()) {
29-
console.log("REPO DELETED");
3029
return false;
3130
}
3231

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414
> Use any of the below options to get gitconvex for your system
1515
16-
[![gitconvex npm package](https://badgen.net/badge/gitconvex/v1.1.1/green?icon=npm)](https://www.npmjs.com/package/@itassistors/gitconvex)
17-
[![github release](https://badgen.net/badge/gitconvex/v1.1.1/blue?icon=github)](https://github.com/neel1996/gitconvex-package/releases)
18-
[![docker image](https://badgen.net/badge/gitconvex/v1.1.1/cyan?icon=docker)](https://hub.docker.com/repository/docker/itassistors/gitconvex)
16+
[![gitconvex npm package](https://badgen.net/badge/gitconvex/v1.1.2/green?icon=npm)](https://www.npmjs.com/package/@itassistors/gitconvex)
17+
[![github release](https://badgen.net/badge/gitconvex/v1.1.2/blue?icon=github)](https://github.com/neel1996/gitconvex-package/releases)
18+
[![docker image](https://badgen.net/badge/gitconvex/v1.1.2/cyan?icon=docker)](https://hub.docker.com/repository/docker/itassistors/gitconvex)
19+
1920
[![License](https://badgen.net/github/license/neel1996/gitconvex-package)](LICENSE)
2021

2122
- **Option - 1** Cloning repo from **github**
@@ -75,3 +76,4 @@ Refer the detailed [Documentation](DOCUMENTATION.md) for how to setup and use th
7576

7677
See [LICENSE ](LICENSE) info for more
7778

79+

build/asset-manifest.json

Lines changed: 851 additions & 851 deletions
Large diffs are not rendered by default.

build/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)