@kodus/cli 0.0.5 → 0.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kodus/cli",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "CLI tool for Kodus installation and management",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -4,6 +4,11 @@ import path from 'path';
4
4
  import { execSync } from 'child_process';
5
5
  import ora from 'ora';
6
6
  import chalk from 'chalk';
7
+ import { fileURLToPath } from 'url';
8
+ import { dirname } from 'path';
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
7
12
 
8
13
  export const generateSecretKey = () => crypto.randomBytes(32).toString("base64");
9
14
 
@@ -15,7 +20,7 @@ export const generateDbPassword = () =>
15
20
  .slice(0, 16);
16
21
 
17
22
  export const copyTemplates = (targetDir) => {
18
- const templatesDir = path.join(process.cwd(), 'templates');
23
+ const templatesDir = path.join(__dirname, '../../templates');
19
24
  fs.copySync(path.join(templatesDir, 'docker-compose.yml'), path.join(targetDir, 'docker-compose.yml'));
20
25
  };
21
26