forked from nvuillam/npm-groovy-lint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script-deploy-in-vscode.js
33 lines (22 loc) · 1.05 KB
/
script-deploy-in-vscode.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /usr/bin/env node
// Copy source files into vscode npm installation (avoid generate betas to test updates)
// npm-groovy-lint & vscode-groovy-lint must be in the same folder, else you have to override VSCODE_GROOVY_LINT_PATH env variable
"use strict";
// Imports
const { existsSync, emptyDirSync, mkdirSync, copySync } = require('fs-extra');
console.log('---- START DEPLOY IN VSCODE INSTALLED npm-groovy-lint PACKAGE ----');
const vsCodeGroovyLintPath = process.env.VSCODE_GROOVY_LINT_PATH || './../vscode-groovy-lint';
const targetPath = `${vsCodeGroovyLintPath}/server/node_modules/npm-groovy-lint/lib`;
console.info(`GroovyLint: Starting copying package in vscode for testing`);
// Reset target folder
if (existsSync(targetPath)) {
emptyDirSync(targetPath);
}
else {
mkdirSync(targetPath);
}
// Copy files into dist folder (copied from lib folder)
copySync('./lib', targetPath);
console.info(`GroovyLint: Copied ./lib files into ${targetPath}`);
console.log('---- END DEPLOY IN VSCODE INSTALLED npm-groovy-lint PACKAGE ----\n');
process.exit(0);