Merge pull request #27710 from backstage/freben/dev

remove the last src/run.ts
This commit is contained in:
Fredrik Adelöw
2024-11-19 14:45:43 +01:00
committed by GitHub
14 changed files with 106 additions and 257 deletions
+1 -2
View File
@@ -15,8 +15,7 @@
*/
import { assertError, ForwardedError } from '@backstage/errors';
import { paths } from '../paths';
import { execFile } from '../run';
import { execFile, paths } from '../util';
/**
* Run a git command, trimming the output splitting it into lines.
@@ -23,7 +23,7 @@ import { GitUtils } from '../git';
const mockListChangedFiles = jest.spyOn(GitUtils, 'listChangedFiles');
const mockReadFileAtRef = jest.spyOn(GitUtils, 'readFileAtRef');
jest.mock('../paths', () => ({
jest.mock('../util', () => ({
paths: {
targetRoot: '/',
resolveTargetRoot: (...paths: string[]) => resolvePath('/', ...paths),
@@ -16,7 +16,7 @@
import path from 'path';
import { getPackages, Package } from '@manypkg/get-packages';
import { paths } from '../paths';
import { paths } from '../util';
import { PackageRole } from '../roles';
import { GitUtils } from '../git';
import { Lockfile } from './Lockfile';
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { paths } from '../paths';
import { paths } from '../util';
import fs from 'fs-extra';
/**
@@ -19,7 +19,7 @@ import { createMockDirectory } from '@backstage/backend-test-utils';
const mockDir = createMockDirectory();
jest.mock('../paths', () => ({
jest.mock('../util', () => ({
paths: { resolveTargetRoot: (...args: string[]) => mockDir.resolve(...args) },
}));
-20
View File
@@ -1,20 +0,0 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { execFile as execFileCb } from 'child_process';
import { promisify } from 'util';
export const execFile = promisify(execFileCb);
@@ -14,7 +14,11 @@
* limitations under the License.
*/
import { execFile as execFileCb } from 'child_process';
import { promisify } from 'util';
import { findPaths } from '@backstage/cli-common';
export const execFile = promisify(execFileCb);
/* eslint-disable-next-line no-restricted-syntax */
export const paths = findPaths(__dirname);