-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathpublish-all.js
65 lines (55 loc) · 1.18 KB
/
publish-all.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
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
62
63
64
65
import { chdir, cwd } from 'node:process';
import { execSync } from 'node:child_process';
import { join } from 'node:path';
export const publish_folder = (path='', throw_on_error=true) => {
const current_working_dir = cwd();
try {
chdir(path);
execSync('npm publish');
} catch(e) {
console.log(`Failed with ${path}`);
console.log(e);
if(throw_on_error) {
throw e;
}
return {
path,
succeed: false
};
} finally {
chdir(current_working_dir);
}
return {
path,
succeed: true
};
}
[
'/cli',
'/core',
'/dashboard',
'/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',
'/sdk',
'/sdk-react-hooks',
]
.slice(0)
.map(
p => join('./packages', p)
)
.map(
p => publish_folder(p, true)
);