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
22e2ac27
Unverified
Commit
22e2ac27
authored
Jul 03, 2019
by
Ryan McKinley
Committed by
GitHub
Jul 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grafana/toolkit: copy sass files (#17888)
include sass files in toolkit
parent
874b8abc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
packages/grafana-toolkit/src/cli/tasks/toolkit.build.ts
+26
-0
No files found.
packages/grafana-toolkit/src/cli/tasks/toolkit.build.ts
View file @
22e2ac27
...
...
@@ -5,6 +5,8 @@ import chalk from 'chalk';
import
{
useSpinner
}
from
'../utils/useSpinner'
;
import
{
Task
,
TaskRunner
}
from
'./task'
;
const
path
=
require
(
'path'
);
let
distDir
:
string
,
cwd
:
string
;
// @ts-ignore
...
...
@@ -74,6 +76,28 @@ const moveFiles = () => {
})();
};
const
copySassFiles
=
()
=>
{
const
files
=
[
'_variables.generated.scss'
,
'_variables.dark.generated.scss'
,
'_variables.light.generated.scss'
];
// @ts-ignore
return
useSpinner
<
void
>
(
`Copy scss files
${
files
.
join
(
', '
)}
files`
,
async
()
=>
{
const
sassDir
=
path
.
resolve
(
cwd
,
'../../public/sass/'
);
const
promises
=
files
.
map
(
file
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
name
=
file
.
replace
(
'.generated'
,
''
);
fs
.
copyFile
(
`
${
sassDir
}
/
${
file
}
`
,
`
${
distDir
}
/sass/
${
name
}
`
,
err
=>
{
if
(
err
)
{
reject
(
err
);
return
;
}
resolve
();
});
});
});
await
Promise
.
all
(
promises
);
})();
};
const
toolkitBuildTaskRunner
:
TaskRunner
<
void
>
=
async
()
=>
{
cwd
=
changeCwdToGrafanaToolkit
();
distDir
=
`
${
cwd
}
/dist`
;
...
...
@@ -84,7 +108,9 @@ const toolkitBuildTaskRunner: TaskRunner<void> = async () => {
await
compile
();
await
preparePackage
(
pkg
);
fs
.
mkdirSync
(
'./dist/bin'
);
fs
.
mkdirSync
(
'./dist/sass'
);
await
moveFiles
();
await
copySassFiles
();
restoreCwd
();
};
...
...
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