Skip to content

Commit 5b72dd0

Browse files
committed
try type assertions
1 parent 9c23639 commit 5b72dd0

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

packages/amazonq/scripts/build/copyFiles.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ interface CopyTask {
2626
readonly destination?: string
2727
}
2828

29+
const cpSync = fs.cpSync as (
30+
source: string,
31+
destination: string,
32+
options?: { recursive: boolean; force: boolean; errorOnExist: boolean }
33+
) => void
34+
2935
const tasks: CopyTask[] = [
3036
...['LICENSE', 'NOTICE'].map((f) => {
3137
return { target: path.join('../../', f), destination: path.join(projectRoot, f) }
@@ -78,7 +84,7 @@ function copy(task: CopyTask): void {
7884
const dst = path.resolve(outRoot, task.destination ?? task.target)
7985

8086
try {
81-
fs.cpSync(src, dst, {
87+
cpSync(src, dst, {
8288
recursive: true,
8389
force: true,
8490
errorOnExist: false,

packages/core/scripts/build/copyFiles.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ interface CopyTask {
2525
readonly destination?: string
2626
}
2727

28+
const cpSync = fs.cpSync as (
29+
source: string,
30+
destination: string,
31+
options?: { recursive: boolean; force: boolean; errorOnExist: boolean }
32+
) => void
33+
2834
const tasks: CopyTask[] = [
2935
{ target: path.join('src', 'templates') },
3036
{ target: path.join('src', 'test', 'shared', 'cloudformation', 'yaml') },
@@ -51,7 +57,7 @@ function copy(task: CopyTask): void {
5157
const dst = path.resolve(outRoot, task.destination ?? task.target)
5258

5359
try {
54-
fs.cpSync(src, dst, {
60+
cpSync(src, dst, {
5561
recursive: true,
5662
force: true,
5763
errorOnExist: false,

packages/toolkit/scripts/build/copyFiles.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ interface CopyTask {
2525
readonly destination?: string
2626
}
2727

28+
const cpSync = fs.cpSync as (
29+
source: string,
30+
destination: string,
31+
options?: { recursive: boolean; force: boolean; errorOnExist: boolean }
32+
) => void
33+
2834
const tasks: CopyTask[] = [
2935
...['LICENSE', 'NOTICE'].map((f) => {
3036
return { target: path.join('../../', f), destination: path.join(projectRoot, f) }
@@ -105,7 +111,7 @@ function copy(task: CopyTask): void {
105111
const dst = path.resolve(outRoot, task.destination ?? task.target)
106112

107113
try {
108-
fs.cpSync(src, dst, {
114+
cpSync(src, dst, {
109115
recursive: true,
110116
force: true,
111117
errorOnExist: false,

0 commit comments

Comments
 (0)