Repository navigation
Expand file tree
/
Copy pathrelease.utils.js
More file actions
61 lines (53 loc) · 1.45 KB
/
Copy pathrelease.utils.js
File metadata and controls
61 lines (53 loc) · 1.45 KB
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
56
57
58
59
60
61
import child_process from 'node:child_process';
import { join } from 'node:path';
import util from 'node:util';
const exec = util.promisify(child_process.exec);
// DEPRECATED. This file is no longer used. Please see release.version.js and release.publish.js for the new release process.
/**
* @description Get packages paths relative to root
*/
export const get_packages = () => [
'/core',
'/cli',
'/dashboard',
'/chat',
'/databases/database-cloudflare-d1',
'/databases/database-mongodb',
'/databases/database-mysql',
'/databases/database-neon',
'/databases/database-planetscale',
'/databases/database-postgres',
'/databases/database-sql-base',
'/databases/database-sqlite',
'/databases/database-turso',
'/storage/storage-google',
'/storage/storage-s3-compatible',
'/mailers/mailer-providers-http',
'/mailers/mailer-smtp',
'/payments/payments-paypal',
'/payments/payments-stripe',
'/payments/payments-razor-pay',
'/sdks/sdk',
'/sdks/sdk-react-hooks',
]
.slice(0)
.map(
p => join('./packages', p)
);
export const exec_command = async (
command='', tag='unknown', verbose_output=true,
throw_on_error=false
) => {
try {
const { stdout, stderr } = await exec(command);
if(verbose_output) {
stdout && console.log(`${tag} stdout:`, stdout);
// stderr && console.error(`${tag} stderr:`, stderr);
}
} catch(e) {
console.error(`${tag} error:`, e);
if(throw_on_error) {
throw e;
}
}
}