mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
chore: cli to create self signed ca to dev with domain (#12466)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a CLI command to manage local Certificate Authority (CA) and generate SSL certificates for development domains. - Added example and template files for Nginx and OpenSSL configurations to support local development with SSL. - Provided new DNS and Nginx configuration files for enhanced local development setup. - **Documentation** - Added a README with step-by-step instructions for setting up development containers and managing certificates on MacOS with OrbStack. - **Chores** - Updated ignore patterns to exclude additional development files and directories. - Enhanced example Docker Compose files with commented service configurations and new volume definitions. - Removed the Elasticsearch example Docker Compose file. - **Refactor** - Extended utility and command classes with new methods to support file operations and command execution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
import { existsSync, statSync } from 'node:fs';
|
||||
import {
|
||||
existsSync,
|
||||
mkdirSync,
|
||||
readFileSync,
|
||||
rmSync,
|
||||
statSync,
|
||||
writeFileSync,
|
||||
} from 'node:fs';
|
||||
import { join, relative, sep } from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
|
||||
@@ -41,6 +48,22 @@ export class Path {
|
||||
return existsSync(this.path);
|
||||
}
|
||||
|
||||
rm(opts: { recursive?: boolean } = {}) {
|
||||
rmSync(this.path, { ...opts, force: true });
|
||||
}
|
||||
|
||||
mkdir() {
|
||||
mkdirSync(this.path, { recursive: true });
|
||||
}
|
||||
|
||||
readAsFile() {
|
||||
return readFileSync(this.path);
|
||||
}
|
||||
|
||||
writeFile(content: Buffer | string) {
|
||||
writeFileSync(this.path, content);
|
||||
}
|
||||
|
||||
stats() {
|
||||
return statSync(this.path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user