@atomicsmash/init-testing 1.0.0-beta.1 → 1.0.0-beta.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/dist/cli.js CHANGED
@@ -51,9 +51,9 @@ const copyFiles = await readdir(copyFolder, {
51
51
  recursive: true,
52
52
  });
53
53
  for (const dirent of copyFiles) {
54
- const relativePath = pathRelative(copyFolder, `${dirent.path}`);
55
- if (relativePath.endsWith("/")) {
56
- relativePath.slice(0, -1);
54
+ let relativePath = pathRelative(copyFolder, `${dirent.path}`);
55
+ if (relativePath !== "" && !relativePath.endsWith("/")) {
56
+ relativePath = `${relativePath}/`;
57
57
  }
58
58
  if (!dirent.isFile()) {
59
59
  continue;
@@ -71,16 +71,16 @@ for (const dirent of copyFiles) {
71
71
  ]) {
72
72
  data = data.replace(search, replace);
73
73
  }
74
- await mkdir(`${process.cwd()}/${relativePath}`, {
74
+ await mkdir(`${process.cwd()}/${relativePath}`.slice(0, -1), {
75
75
  recursive: true,
76
76
  });
77
- await writeFile(`${process.cwd()}/${relativePath}/${dirent.name}`, data, {
77
+ await writeFile(`${process.cwd()}/${relativePath}${dirent.name}`, data, {
78
78
  encoding: "utf8",
79
79
  flag: argv.overwriteFiles ? "w" : "wx",
80
80
  });
81
- return `${relativePath}/${dirent.name} copied successfully.`;
81
+ return `${relativePath}${dirent.name} copied successfully.`;
82
82
  })
83
- .catch((error) => `${relativePath}/${dirent.name} failed to copy. Error: ${error}`));
83
+ .catch((error) => `${relativePath}${dirent.name} failed to copy. Error: ${error}`));
84
84
  }
85
85
  await Promise.all([
86
86
  Promise.allSettled([
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atomicsmash/init-testing",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.1",
4
+ "version": "1.0.0-beta.3",
5
5
  "description": "Allow us to easily add automated testing setup to any npm setup.",
6
6
  "keywords": [
7
7
  "atomic",
File without changes
File without changes