mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-03-13 14:56:54 +08:00
feat(cli): Copy plugins folder to server.
This commit is contained in:
parent
d66d395e01
commit
9f4ff92573
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import addCustomPluginsAsDeps from '../../utils/addCustomPluginsAsDeps.js';
|
||||
import copyPluginsFolder from '../../utils/copyPluginsFolder.js';
|
||||
import getServer from '../../utils/getServer.js';
|
||||
import installServer from '../../utils/installServer.js';
|
||||
import mergePackageJson from '../../utils/mergePackageJson.js';
|
||||
@ -29,6 +30,7 @@ async function build({ context }) {
|
||||
context,
|
||||
serverDirectory: directory,
|
||||
});
|
||||
await copyPluginsFolder({ context });
|
||||
await addCustomPluginsAsDeps({ context, directory });
|
||||
await installServer({ context, directory });
|
||||
await runLowdefyBuild({ context, directory });
|
||||
|
31
packages/cli/src/utils/copyPluginsFolder.js
Normal file
31
packages/cli/src/utils/copyPluginsFolder.js
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2020-2021 Lowdefy, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { copyDirectory } from '@lowdefy/node-utils';
|
||||
|
||||
async function copyPluginsFolder({ context }) {
|
||||
if (context.directories.config === context.directories.server) return;
|
||||
if (!fs.existsSync(path.resolve(context.directories.config, 'plugins'))) return;
|
||||
|
||||
await copyDirectory(
|
||||
path.resolve(context.directories.config, 'plugins'),
|
||||
path.resolve(context.directories.server, 'plugins')
|
||||
);
|
||||
}
|
||||
|
||||
export default copyPluginsFolder;
|
Loading…
x
Reference in New Issue
Block a user