forked from devcontainers/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerignoreUtils.ts
More file actions
16 lines (13 loc) · 849 Bytes
/
dockerignoreUtils.ts
File metadata and controls
16 lines (13 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { CLIHost } from '../spec-common/cliHost';
export async function copyDockerIgnoreFileIfExists(cliHost: CLIHost, sourceDockerfilePath: string, targetDockerfilePath: string) {
const sourceDockerIgnorePath = `${sourceDockerfilePath}.dockerignore`;
if (!(await cliHost.isFile(sourceDockerIgnorePath))) {
return;
}
const targetDockerIgnorePath = `${targetDockerfilePath}.dockerignore`;
await cliHost.writeFile(targetDockerIgnorePath, await cliHost.readFile(sourceDockerIgnorePath));
}