json-crud-ui-components 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  import getLatestVersion from "./core/getLatestVersion.js";
4
4
  import loadRunner from "./core/loadRunner.js";
@@ -2,19 +2,14 @@ import path from "path";
2
2
  import fs from "fs";
3
3
 
4
4
  const validate = ({ toPath }) => {
5
- const htmlPath = path.join(toPath, "index.html");
6
- const indexPath = path.join(toPath, "index");
5
+ if (fs.existsSync(toPath)) {
7
6
 
8
- if (!fs.existsSync(htmlPath)) {
9
- console.log("index.html not found");
7
+ const files = fs.readdirSync(toPath);
10
8
 
11
- return true;
12
- };
13
-
14
- if (fs.existsSync(indexPath)) {
15
- console.log("index folder found");
16
-
17
- return true;
9
+ if (files.length > 0) {
10
+ console.log("index folder should be empty");
11
+ return true;
12
+ };
18
13
  };
19
14
 
20
15
  return false;
@@ -1,7 +1,5 @@
1
1
  import fs from "fs";
2
2
 
3
3
  export const createProject = ({ source, destination }) => {
4
- fs.mkdirSync(destination, { recursive: true });
5
-
6
4
  fs.cpSync(source, destination, { recursive: true });
7
5
  };
@@ -1,5 +1,4 @@
1
1
  import { locateSource } from "./initHtml/steps/locateSource.js";
2
- import { locateDestination } from "./initHtml/steps/locateDestination.js";
3
2
 
4
3
  import { createProject } from "./initHtml/steps/createProject.js";
5
4
  import { announce } from "./initHtml/steps/announce.js";
@@ -17,7 +16,7 @@ export default ({ folderName = "", toPath = process.cwd(), inAnnounce = true })
17
16
  });
18
17
 
19
18
  const source = locateSource();
20
- const destination = locateDestination({ inResolvedFolderName: resolvedFolderName });
19
+ const destination = resolvedFolderName;
21
20
 
22
21
  createProject({ source, destination });
23
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-crud-ui-components",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "working on ui for our json crud using modules",
5
5
  "keywords": [
6
6
  "cli",