mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-11-29 10:48:30 +08:00
fix: exclude packages/pro-plugins
This commit is contained in:
parent
816616cca0
commit
dd9f5d5e52
@ -41,8 +41,7 @@
|
||||
"version:alpha": "lerna version prerelease --preid alpha --force-publish=* --no-git-tag-version -m \"chore(versions): publish packages %s\"",
|
||||
"release:force": "lerna publish from-package --yes --no-git-tag-version",
|
||||
"release": "lerna publish",
|
||||
"run:example": "tsx -r dotenv/config -r tsconfig-paths/register ./examples/index.ts",
|
||||
"prepare": "[ -z \"$CI\" ] && echo \"packages/pro-plugins/\" > .git/info/exclude || true"
|
||||
"run:example": "tsx -r dotenv/config -r tsconfig-paths/register ./examples/index.ts"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/react": "^17.0.0",
|
||||
|
@ -9,11 +9,27 @@
|
||||
|
||||
const { Command } = require('commander');
|
||||
const { run, isDev, isPackageValid, generatePlaywrightPath } = require('../util');
|
||||
const { resolve } = require('path');
|
||||
const { existsSync } = require('fs');
|
||||
const { dirname, resolve } = require('path');
|
||||
const { existsSync, mkdirSync, readFileSync, appendFileSync } = require('fs');
|
||||
const { readFile, writeFile } = require('fs').promises;
|
||||
const { createStoragePluginsSymlink, createDevPluginsSymlink } = require('@nocobase/utils/plugin-symlink');
|
||||
|
||||
function writeToExclude() {
|
||||
const excludePath = resolve(process.cwd(), '.git', 'info', 'exclude');
|
||||
const content = 'packages/pro-plugins/\n';
|
||||
const dirPath = dirname(excludePath);
|
||||
if (!existsSync(dirPath)) {
|
||||
mkdirSync(dirPath, { recursive: true });
|
||||
}
|
||||
let fileContent = '';
|
||||
if (existsSync(excludePath)) {
|
||||
fileContent = readFileSync(excludePath, 'utf-8');
|
||||
}
|
||||
if (!fileContent.includes(content)) {
|
||||
appendFileSync(excludePath, content);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Command} cli
|
||||
*/
|
||||
@ -24,6 +40,8 @@ module.exports = (cli) => {
|
||||
.allowUnknownOption()
|
||||
.option('--skip-umi')
|
||||
.action(async (options) => {
|
||||
writeToExclude();
|
||||
|
||||
generatePlaywrightPath(true);
|
||||
await createStoragePluginsSymlink();
|
||||
if (!isDev()) {
|
||||
|
Loading…
Reference in New Issue
Block a user