GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lowcode-engine/modules/code-generator/scripts/run-demo-project at main · csdaa/lowcode-engine

Expand file tree

/

run-demo-project

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
55 lines (47 loc) · 1.57 KB
/

run-demo-project

Copy path

File metadata and controls

executable file
·
55 lines (47 loc) · 1.57 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env node
// @ts-check
const program = require('commander');
const { spawnSync } = require('child_process');
const glob = require('glob');
const fs = require('fs');
const path = require('path');
const _ = require('lodash');
program
.option('--npm <npm>', 'specify the npm command location or alias')
.arguments('<project>')
.action((project, options) => {
try {
if (!fs.existsSync(project)) {
throw new Error(`Project ${project} does not exist`);
}
const getProjectActualPath = [
() => path.resolve(process.cwd(), project),
() =>
path.resolve(
process.cwd(),
path.join(
project,
path.dirname(glob.sync('*/package.json', { cwd: project })[0] || ''),
),
),
]
.map((x) => _.memoize(x))
.find((x) => fs.existsSync(path.join(x(), 'package.json')));
if (!getProjectActualPath) {
throw new Error(`Project ${project} is not a valid project(no package.json)`);
}
const projectActualPath = getProjectActualPath();
if (path.resolve(process.cwd(), project) !== projectActualPath) {
console.log('Changing directory to', path.relative(process.cwd(), projectActualPath));
}
process.chdir(projectActualPath);
const npm = options.npm || 'npm';
const cmd = `${npm} install && ${npm} start`;
console.log('# %s', cmd);
spawnSync(cmd, { stdio: 'inherit', shell: true });
} catch (err) {
console.log(err);
process.exit(1);
}
});
program.parse(process.argv);
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.