Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tlovett1 committed Apr 11, 2024
1 parent f3e5163 commit 47f41c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/toolkit/scripts/project/bash/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ fi
# If template is not empty, git clone template to init_path
if [ ! -z "$template" ]; then
git clone "$template" "$init_path"
rm -rf "$init_path/.git"
fi

rm -rf "$init_path/.git"

# Fixes weird sed error
LANG=C

Expand Down
9 changes: 8 additions & 1 deletion packages/toolkit/utils/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ const readPkg = require('read-pkg');
*/
const { getCurrentWorkingDirectory } = require('./process');

const { packageJson: pkg, path: pkgPath } = readPkgUp.sync({
let pkg;
let pkgPath;
const packageData = readPkgUp.sync({
cwd: realpathSync(getCurrentWorkingDirectory()),
});

if (packageData && packageData.packageJson && packageData.path) {
pkg = packageData.packageJson;
pkgPath = packageData.path;
}

const getPackage = () => pkg;

const getPackagePath = () => pkgPath;
Expand Down

0 comments on commit 47f41c2

Please sign in to comment.