-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from biaov/release/v1.6.0
更新代码
- Loading branch information
Showing
8 changed files
with
828 additions
and
1,331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# 默认模板仓库地址 | ||
# 其它模板地址: https://github.com/biaov/project-template.git | ||
VITE_TEMPLATE_GIT_URL='https://gitee.com/biaovorg/project-template.git' | ||
|
||
# VSCode 配置仓库地址 | ||
VITE_VSCODE_GIT_URL='https://gitee.com/biaovorg/vscode-config.git#master' |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import download from 'download-git-repo' // 用于下载项目模板 | ||
import { cpSync, rmSync } from 'fs' // 读写文件 | ||
import { join } from 'path' | ||
import type { DownloadVSCodeConfig } from './types' | ||
|
||
const fileOption = { recursive: true, force: true } | ||
|
||
/** | ||
* 下载 vscode 配置文件 | ||
*/ | ||
export const downloadVSCodeConfig = ({ projectName }: DownloadVSCodeConfig.Option) => { | ||
const tempFileName = `${+new Date()}` | ||
const processCwd = `${process.cwd()}\\${projectName}\\${tempFileName}` | ||
const projectPath = join(process.cwd(), projectName) | ||
const tempPath = join(projectPath, tempFileName) | ||
|
||
download(`direct:${import.meta.env.VITE_VSCODE_GIT_URL}`, tempPath, { clone: true }, async (err: Error): Promise<void> => { | ||
!err && cpSync(join(tempPath, '.vscode'), join(projectPath, '.vscode'), fileOption) | ||
rmSync(tempPath, fileOption) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters