Skip to content

Commit

Permalink
fix: logs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrednic-1A committed Mar 28, 2024
1 parent e673292 commit 3aa9e25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@o3r/telemetry/src/environment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function isSupportedPackageManager(name?: any): name is SupportedPackageManagers
*/
function getPackageManager() {
if (isSupportedPackageManager(process.env?.ENFORCED_PACKAGE_MANAGER)) {
return (process.env.ENFORCED_PACKAGE_MANAGE === 'npm') ? 'npm' : 'yarn';
return (process.env.ENFORCED_PACKAGE_MANAGER === 'npm') ? 'npm' : 'yarn';
}
return (process.env?.npm_execpath?.includes('yarn') && 'yarn') || 'npm';
}
Expand Down
5 changes: 5 additions & 0 deletions packages/@o3r/test-helpers/src/utilities/package-manager.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import { execFileSync, ExecSyncOptions } from 'node:child_process';
import { appendFileSync, existsSync, readFileSync, rmSync } from 'node:fs';
import { join, posix, sep } from 'node:path';
Expand Down Expand Up @@ -82,6 +83,8 @@ export function isYarn1Enforced() {
* @param packageManager
*/
export function addDashesForNpmCommand(args?: string[], packageManager = getPackageManager()) {
console.log('in addDashes args - $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$', args);
console.log('in addDashes packageManager - $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$', packageManager);
if (!args) {
return [];
}
Expand Down Expand Up @@ -128,6 +131,8 @@ export function packageManagerAdd(packages: string, options: ExecSyncOptions) {
export function packageManagerCreate(command: CommandArguments, options: ExecSyncOptions, packageManagerOverride?: keyof typeof PACKAGE_MANAGERS_CMD) {
const { script, args } = command;
const packageManager = packageManagerOverride || getVersionedPackageManager();
console.log('in package manager create - packageManagerOverride $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$', packageManagerOverride);
console.log('in package manager create - getVersionedPackageManager() $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$', getVersionedPackageManager());
return execCmd([...PACKAGE_MANAGERS_CMD[packageManager].create, script, ...addDashesForNpmCommand(args, packageManager)], options);
}

Expand Down

0 comments on commit 3aa9e25

Please sign in to comment.