fix: Remove copy plugins folder functionality

This commit is contained in:
Sam 2023-01-16 15:02:27 +02:00
parent 4dbd286451
commit 6c5e35f68d
No known key found for this signature in database
GPG Key ID: D004126FCD1A6DF0
3 changed files with 0 additions and 39 deletions

View File

@ -15,7 +15,6 @@
*/
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 readDotEnv from '../../utils/readDotEnv.js';
@ -27,7 +26,6 @@ async function build({ context }) {
readDotEnv(context);
const directory = context.directories.server;
await getServer({ context, packageName: '@lowdefy/server', directory });
await copyPluginsFolder({ context, directory });
await addCustomPluginsAsDeps({ context, directory });
await installServer({ context, directory });
await runLowdefyBuild({ context, directory });

View File

@ -15,7 +15,6 @@
*/
import addCustomPluginsAsDeps from '../../utils/addCustomPluginsAsDeps.js';
import copyPluginsFolder from '../../utils/copyPluginsFolder.js';
import installServer from '../../utils/installServer.js';
import runDevServer from './runDevServer.js';
import getServer from '../../utils/getServer.js';
@ -24,7 +23,6 @@ async function dev({ context }) {
const directory = context.directories.dev;
context.print.info('Starting development server.');
await getServer({ context, packageName: '@lowdefy/server-dev', directory });
await copyPluginsFolder({ context, directory });
await addCustomPluginsAsDeps({ context, directory });
await installServer({ context, directory });
context.sendTelemetry();

View File

@ -1,35 +0,0 @@
/*
Copyright 2020-2022 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 { cleanDirectory, copyDirectory } from '@lowdefy/node-utils';
async function copyPluginsFolder({ context, directory }) {
if (context.directories.config === directory) return;
if (!fs.existsSync(path.join(context.directories.config, 'plugins'))) return;
await cleanDirectory(path.join(directory, 'plugins'));
await copyDirectory(
path.join(context.directories.config, 'plugins'),
path.join(directory, 'plugins'),
{
filter: (path) => !path.includes('node_modules'),
}
);
}
export default copyPluginsFolder;