# svn-code

> A cli tool for loca ctrl

Latest version **1.1.9** (published 2022-03-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install svn-code
pnpm add svn-code
yarn add svn-code
bun add svn-code
```

Provides the command `scnpm`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.9 |
| Published | 2022-03-10 |
| First published | 2022-03-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 6 |
| Unpacked size | 29.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wangpeng |
| Maintainers | vue-configs |
| Keywords | vue, npm, nodejs, svn, svn-code |

## Links

- npm: https://www.npmjs.com/package/svn-code
- npm.io page: https://npm.io/package/svn-code

## Dependencies (6)

- [ora](https://npm.io/package/ora.md) ^2.0.0
- [chalk](https://npm.io/package/chalk.md) ^2.4.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [node-cmd](https://npm.io/package/node-cmd.md) ^5.0.0
- [commander](https://npm.io/package/commander.md) ^2.15.1
- [silly-datetime](https://npm.io/package/silly-datetime.md) ^0.1.2

## Recent versions

- 1.1.9 (latest) — 2022-03-10
- 1.1.8 — 2022-03-10
- 1.1.7 — 2022-03-10
- 1.1.6 — 2022-03-04
- 1.1.5 — 2022-03-04
- 1.1.3 — 2022-03-04
- 1.1.2 — 2022-03-03
- 1.1.1 — 2022-03-03
- 1.1.0 — 2022-03-03
- 1.0.27 — 2022-03-03
- 1.0.26 — 2022-03-03
- 1.0.25 — 2022-03-03
- 1.0.24 — 2022-03-03
- 1.0.23 — 2022-03-03
- 1.0.22 — 2022-03-03
- … 15 more at https://npm.io/package/svn-code/versions

## README

# svn-code

**svn based on the efficient conversion plug-in**
svn-code

<p>
  <a href="https://www.npmjs.org/package/svn-code" rel="nofollow"><img src="https://img.shields.io/npm/v/svn-code.svg?style=flat-square" alt="svn-code"></a>
  <a href="https://npmjs.org/package/svn-code" rel="nofollow"><img src="http://img.shields.io/npm/dm/svn-code.svg?style=flat-square" alt="NPM downloads"></a>
  <a href="https://npmjs.org/package/svn-code" rel="nofollow"><img src="https://img.shields.io/npm/dt/svn-code.svg?style=flat-square" alt="NPM downloads"></a>
</p>

### Installation

Prerequisites: [Node.js](https://nodejs.org/en/) (>=4.x, 6.x preferred), npm version 3+.

``` bash
npm install -g svn-code
```

### Usage
#### 第一步 初始化配置
``` javascript
scnpm init
```

执行完毕init命令，会在【C:\\svn-code】目录初始化全局配置文件

```
{
	//本地仓库地址
	"loca-warehouse": "D:\\svn-code-warehouse",
	//已初始化的项目列表
	"config-project": [
		{
			"url": "C:\\Users\\xxx\\xxx"
		}
	]
}
```

#### 第二步 修改配置文件
``` javascript
{
	//默认的插件存放相对路径
	"pulg-path": "src/svn-code-page",
	//本项目所需插件列表
	"pulg-in": [
		{
			//已内置的则可以直接配置name
			"name":"xxxx"
		},{
			/* 还可以配置个性化的其余插件 */
			
			//svn地址
			"svnurl":"svn://xxxx.com/xxxx/xxxx",
			//插件名（一般即为文件名）
			"folderName":"svn",
			//本插件所放相对路径，不配置则取默认相对路径
			"pulg-path": "src/svn-code-page2"
		}
	]
}
```

#### 第三步 安装/更新
``` javascript
scnpm install
```

#### 场景分析
- 1、当我在需要删除本项目配置时该怎么办？

删除配置不建议直接删除配置文件（除非仅用于同步文件），因为在本地磁盘还保存有全局配置文件，里面含有本项目相关配置

如果真的是直接手动删除配置文件 且 不再需要，只能前往【C:\\svn-code】手动删除指定的已配置项目列表项

建议：

``` javascript
//删除本项目配置文件
scnpm delete
//或者 删除本项目配置文件 和 本项目产生的插件文件
scnpm deleteAll
```

- 2、当我需要更换插件在项目中的路径时怎么办？

更换路径不建议直接修改配置文件并install，这样的话项目中原有的已经install生成的插件不会删除

建议先删除已成生的插件

``` javascript
scnpm deleteCode
```

- 3、当我本地很多项目都使用了svn-code生成了插件，我该怎么一次性全部install

在单个项目init、install时，已自动将本项目配置到了全局公共配置文件，所以只需要在任意目录运行命令

``` javascript
scnpm installAll
```

- 4、当不小心本地全局配置文件受损怎么办？

如果全局配置文件受损，则需要每个用到的项目都执行init命令即可。

- 5、当频繁在执行某命令时需要install时该怎么办？

如果在频繁执行某npm命令时都需要install，比如npm run dev、npm run build时，可以参考：

【关于运行时更新插件命令】


#### 全部命令

- 1、关于插件配置类命令

``` javascript
// 初始化配置文件
scnpm init

// 根据配置文件安装插件
scnpm install

// 根据配置文件 安装所有其他和本项目共享本地库的项目的插件（只要项目关联的本地仓库一致，则为共享）
scnpm installAll

// 删除配置文件
scnpm delete

// 删除配置安装的所有插件
scnpm deleteCode

// 删除配置、安装的所有插件
scnpm deleteAll

// 初始化插件目录
scnpm initWarehouse
```

- 2、关于运行时更新插件命令
``` javascript
scnpm run dev
//等同于
npm run dev


scnpm run build
//等同于
npm run build


scnpm xx xxx xxx
//等同于
npm xx xxx xxx

...

```

### notice
本插件致力于根据配置文件，管理公共的模块，模块放在svn服务器，在install后会在本地磁盘创建仓库，并根据配置选择性覆盖项目内的插件

综上所述，本插件在执行时依赖svn命令，请确保电脑支持svn命令

打开电脑cmd后，运行svn，如果不提示无此命令，则一切正常，否则需要重新安装svn（不需要卸载，可以保留已有的svn账户），在安装时选中【command line client tools】，然后重启电脑

---
_Source: https://npm.io/package/svn-code · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
