Skip to content

Commit 853ed94

Browse files
committed
gulp automation for copying svgs
1 parent b578f02 commit 853ed94

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

gulpfile.ts

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,38 @@
1-
import { series } from 'gulp';
1+
import { series, parallel } from 'gulp';
22
import { clean } from './utils/clean';
3+
import { copy } from './utils/copy';
34

45
export default series(
56

67
// Cleaning 'src','svg','es','lib' before copying SVGs from 'EOS-Icons'
7-
clean(['src','svg','es','lib'])
8+
clean(['src','svg','es','lib']),
9+
10+
// Running all the tasks of copying SVGs from 'EOS-Icons' in parallel
11+
parallel(
12+
13+
copy({
14+
from: ['node_modules/eos-icons/svg/*.svg'],
15+
toDir: 'svg/filled'
16+
}),
17+
18+
copy({
19+
from: ['node_modules/eos-icons/svg/material/*.svg'],
20+
toDir: 'svg/filled'
21+
}),
22+
23+
copy({
24+
from: ['node_modules/eos-icons/animated-svg/*.svg'],
25+
toDir: 'svg/animated'
26+
}),
27+
28+
copy({
29+
from: ['node_modules/eos-icons/svg-outlined/*.svg'],
30+
toDir: 'svg/outlined'
31+
}),
32+
33+
copy({
34+
from: ['node_modules/eos-icons/svg-outlined/material/*.svg'],
35+
toDir: 'svg/outlined'
36+
})
37+
)
838
);

interface/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface CopyCreatorOptions {
2+
from: string[];
3+
toDir: string;
4+
}

utils/copy.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { src, dest } from 'gulp';
2+
import { CopyCreatorOptions } from '../interface';
3+
4+
export const copy = ({ from, toDir }: CopyCreatorOptions) =>
5+
function CopyFiles() {
6+
return src(from).pipe(dest(toDir));
7+
};

0 commit comments

Comments
 (0)