Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
ed054c20
Unverified
Commit
ed054c20
authored
Sep 23, 2020
by
kennytm
Committed by
GitHub
Sep 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grafana-toolkit: avoid path.resolve with globby in moveStaticFiles (#27670)
parent
52a501c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
packages/grafana-toolkit/src/cli/tasks/package.build.ts
+4
-5
No files found.
packages/grafana-toolkit/src/cli/tasks/package.build.ts
View file @
ed054c20
...
...
@@ -3,7 +3,6 @@ import execa = require('execa');
import
*
as
fs
from
'fs'
;
// @ts-ignore
import
*
as
path
from
'path'
;
import
{
resolve
as
resolvePath
}
from
'path'
;
import
chalk
from
'chalk'
;
import
{
useSpinner
}
from
'../utils/useSpinner'
;
import
{
Task
,
TaskRunner
}
from
'./task'
;
...
...
@@ -89,13 +88,13 @@ const moveFiles = () => {
})();
};
const
moveStaticFiles
=
async
(
pkg
:
any
,
cwd
:
string
)
=>
{
const
moveStaticFiles
=
async
(
pkg
:
any
)
=>
{
if
(
pkg
.
name
.
endsWith
(
'/ui'
))
{
const
staticFiles
=
await
globby
(
resolvePath
(
process
.
cwd
(),
'src/**/*.+(png|svg|gif|jpg)'
)
);
const
staticFiles
=
await
globby
(
'src/**/*.{png,svg,gif,jpg}'
);
return
useSpinner
<
void
>
(
`Moving static files`
,
async
()
=>
{
const
promises
=
staticFiles
.
map
(
file
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
fs
.
copyFile
(
file
,
`
${
cwd
}
/compiled/
${
file
.
replace
(
`
${
cwd
}
/src`
,
''
)}
`
,
(
err
:
any
)
=>
{
fs
.
copyFile
(
file
,
file
.
replace
(
/^src/
,
'compiled'
)
,
(
err
:
any
)
=>
{
if
(
err
)
{
reject
(
err
);
return
;
...
...
@@ -130,7 +129,7 @@ const buildTaskRunner: TaskRunner<PackageBuildOptions> = async ({ scope }) => {
await
clean
();
await
compile
();
await
moveStaticFiles
(
pkg
,
cwd
);
await
moveStaticFiles
(
pkg
);
await
rollup
();
await
preparePackage
(
pkg
);
await
moveFiles
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment