Skip to content

Commit

Permalink
fix: windows pwd path (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbazelczuk committed Mar 24, 2022
1 parent 0307e1c commit 4c48d4d
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 35 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/validate-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,25 @@ jobs:
run: npm ci
- name: Run linter
run: npm run lint

build:
runs-on: ${{ matrix.os }}
needs: validate-code
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node: [16]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Dependencies
run: |
npm ci
npm ci --prefix=examples/basic
npm ci --prefix=examples/advanced
- name: Run build basic
run: npm run build --prefix=examples/basic
- name: Run build advanced
run: npm run build --prefix=examples/advanced


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The packager consists of the following features:

## Prerequisites
- node version 16+
- npm version 7
- npm version 8+

## Quick start
1. Install the Packager
Expand Down
3 changes: 2 additions & 1 deletion base-manifest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const packageJson = require(process.env.PWD + '/package.json');
const path = require('path')
const packageJson = require(path.join(process.cwd(), 'package.json'));
const versionParts = packageJson.version.split('.');

module.exports = {
Expand Down
10 changes: 5 additions & 5 deletions examples/advanced/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "1.0.0",
"description": "Advanced example kopytko-packager based app",
"scripts": {
"build": "node node_modules/@kopytko/packager/scripts/build.js",
"start": "node node_modules/@kopytko/packager/scripts/start.js"
"build": "node ./node_modules/@kopytko/packager/scripts/build.js",
"start": "node ./node_modules/@kopytko/packager/scripts/start.js"
},
"private": true,
"devDependencies": {
Expand Down
21 changes: 13 additions & 8 deletions examples/basic/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "1.0.0",
"description": "Basic example kopytko-packager based app",
"scripts": {
"build": "node node_modules/@kopytko/packager/scripts/build.js",
"start": "node node_modules/@kopytko/packager/scripts/start.js"
"build": "node ./node_modules/@kopytko/packager/scripts/build.js",
"start": "node ./node_modules/@kopytko/packager/scripts/start.js"
},
"private": true,
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"Tomasz Bazelczuk <tbazelczuk@gmail.com>"
],
"engines": {
"node": ">=14.0.0",
"npm": ">=7.0.0"
"node": ">=16.0.0",
"npm": ">=8.0.0"
},
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/env/kopytkorc-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@ module.exports = class KopytkorcReader {
}

_getAbsolutePath(projectPath) {
return path.join(process.env.PWD, projectPath);
return path.join(process.cwd(), projectPath);
}
}
2 changes: 1 addition & 1 deletion src/plugin-helpers/module/build-module-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const findDir = (name, parentDir) => {
}
}

return getModuleDir(process.env.PWD, name);
return getModuleDir(process.cwd(), name);
}

const getModuleDir = (parentDir, name) => path.join(parentDir, 'node_modules/', name);
2 changes: 1 addition & 1 deletion src/plugin-helpers/module/get-npm-list.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const childProcess = require('child_process');

module.exports = function getNpmList({
cwd = process.env.PWD,
cwd = process.cwd(),
depth = null,
prodOnly = true,
} = {}) {
Expand Down
6 changes: 3 additions & 3 deletions src/step-runner/steps/build/build-step-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const args = require('../../../env/args');
const kopytkoConfig = require('../../../env/kopytko-config');

module.exports = {
archivePath: path.join(process.env.PWD, kopytkoConfig.archivePath),
archivePath: path.join(process.cwd(), kopytkoConfig.archivePath),
env: args.env,
rootDir: process.env.PWD,
sourceDir: path.join(process.env.PWD, kopytkoConfig.sourceDir),
rootDir: process.cwd(),
sourceDir: path.join(process.cwd(), kopytkoConfig.sourceDir),
tempDir: kopytkoConfig.tempDir,
}
2 changes: 1 addition & 1 deletion src/step-runner/steps/deploy/deploy-step-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const args = require('../../../env/args');
const kopytkoConfig = require('../../../env/kopytko-config');

module.exports = {
archivePath: path.join(process.env.PWD, kopytkoConfig.archivePath),
archivePath: path.join(process.cwd(), kopytkoConfig.archivePath),
rokuIP: args.rokuIP,
rokuDevPassword: args.rokuDevPassword,
rokuDevUser: args.rokuDevUser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const path = require('path');
const kopytkoConfig = require('../../../env/kopytko-config');

module.exports = {
archivePath: path.join(process.env.PWD, kopytkoConfig.archivePath),
outputDir: path.join(process.env.PWD, '/out/debug/'),
archivePath: path.join(process.cwd(), kopytkoConfig.archivePath),
outputDir: path.join(process.cwd(), '/out/debug/'),
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const args = require('../../../env/args');
const kopytkoConfig = require('../../../env/kopytko-config');

module.exports = {
generatedPackagePath: path.join(process.env.PWD, kopytkoConfig.generatedPackagePath),
generatedPackagePath: path.join(process.cwd(), kopytkoConfig.generatedPackagePath),
rokuIP: args.rokuIP,
rokuDevPassword: args.rokuDevPassword,
rokuDevUser: args.rokuDevUser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path');
const args = require('../../../env/args');

module.exports = {
signedPackagePath: path.join(process.env.PWD, args.signedPackagePath),
signedPackagePath: path.join(process.cwd(), args.signedPackagePath),
rokuIP: args.rokuIP,
rokuDevPassword: args.rokuDevPassword,
rokuDevUser: args.rokuDevUser,
Expand Down
2 changes: 1 addition & 1 deletion src/step-runner/steps/screenshot/screenshot-step-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ module.exports = {
rokuIP: args.rokuIP,
rokuDevPassword: args.rokuDevPassword,
rokuDevUser: args.rokuDevUser,
screenshotDir: path.join(process.env.PWD, kopytkoConfig.screenshotDir),
screenshotDir: path.join(process.cwd(), kopytkoConfig.screenshotDir),
}

0 comments on commit 4c48d4d

Please sign in to comment.