diff --git a/create-cospace/index.js b/create-cospace/index.js index 661479e..f1e81e4 100644 --- a/create-cospace/index.js +++ b/create-cospace/index.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +import { fileURLToPath } from "url"; import * as path from "path"; import fs from "fs-extra"; import meow from "meow"; @@ -58,8 +59,9 @@ const init = async () => { console.log(`\nCreating cospace in ${cospaceDir}...`); - const __dirname = path.resolve() - await fs.copy(path.join(__dirname, "../template"), cospaceDir); + const __filename = fileURLToPath(import.meta.url); + const __dirname = path.dirname(__filename); + await fs.copy(path.join(__dirname, "./template"), cospaceDir); process.chdir(cospaceDir); diff --git a/create-cospace/package.json b/create-cospace/package.json index 1ae8582..43f892c 100644 --- a/create-cospace/package.json +++ b/create-cospace/package.json @@ -1,6 +1,6 @@ { "name": "create-cospace", - "version": "0.1.2", + "version": "0.1.3", "description": "Setup a `CoSpace` to link multiple (mono)repos together!", "author": "https://github.com/aruniverse", "repository": {