Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010182
find-scss-includes.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
943 B
Referenced Files
None
Subscribers
None
find-scss-includes.ts
View Options
import
{
promises
as
fs
}
from
"fs"
;
import
_locreq
from
"locreq"
;
import
{
relative
}
from
"path"
;
import
{
walkDir
}
from
"./utils/walk"
;
const
target_locreq
=
_locreq
(
process
.
cwd
());
export
async
function
generateScssIncludes
()
:
Promise
<
void
>
{
const
files
=
await
Promise
.
all
(
(
await
walkDir
(
target_locreq
.
resolve
(
"src/"
)))
.
filter
(
(
f
)
=>
f
.
endsWith
(
".scss"
)
&&
!
f
.
endsWith
(
"/main.scss"
)
&&
!
f
.
endsWith
(
"/includes.scss"
)
)
.
map
((
fullpath
)
=>
relative
(
target_locreq
.
resolve
(
"src/"
),
fullpath
)
)
);
await
fs
.
writeFile
(
target_locreq
.
resolve
(
"src/includes.scss"
),
`// DO NOT EDIT! This file is generated automaticaly with npx sealgen generate-scss-includes
@import "../node_modules/@sealcode/sealgen/src/forms/forms.scss";
${
files
.
map
((
path
)
=>
`@import "
${
path
}
";`
).
join
(
"\n"
)
}
`
);
// eslint-disable-next-line no-console
console
.
log
(
"Successfuly generated new src/includes.scss file"
);
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Wed, May 7, 19:37 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
624915
Default Alt Text
find-scss-includes.ts (943 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment