FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
adminforth/adminforth/scripts/postinstall.js at main · devforth/adminforth · GitHub
devforth
adminforth
Repository navigation
Code
Issues
16
(16)
Pull requests
4
(4)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
adminforth
/
adminforth
/
scripts
/
postinstall.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (22 loc) · 890 Bytes
Breadcrumbs
adminforth
/
adminforth
/
scripts
/
postinstall.js
Copy path
File metadata and controls
25 lines (22 loc) · 890 Bytes
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
import
fs
from
'node:fs'
;
import
path
from
'node:path'
;
import
{
fileURLToPath
}
from
'node:url'
;
const
nodeBinary
=
process
.
execPath
;
const
__filename
=
fileURLToPath
(
import
.
meta
.
url
)
;
const
__dirname
=
path
.
dirname
(
__filename
)
;
const
spaPath
=
path
.
join
(
__dirname
,
'dist'
,
'spa'
)
;
const
pnpmPotentionalPath
=
path
.
join
(
nodeBinary
,
'..'
,
'pnpm'
)
;
const
doesUserProjectHasPnpm
=
fs
.
existsSync
(
pnpmPotentionalPath
)
console
.
log
(
'doesUserProjectHasPnpm'
,
doesUserProjectHasPnpm
)
;
if
(
doesUserProjectHasPnpm
)
{
if
(
fs
.
existsSync
(
spaPath
)
&&
!
process
.
env
.
PNPM_INSTALL_SPA
)
{
process
.
env
.
PNPM_INSTALL_SPA
=
1
;
require
(
'child_process'
)
.
execSync
(
'pnpm install --frozen-lockfile'
,
{
cwd
:
spaPath
,
stdio
:
'inherit'
}
)
;
}
}
else
{
if
(
fs
.
existsSync
(
spaPath
)
)
{
process
.
chdir
(
spaPath
)
;
require
(
'child_process'
)
.
execSync
(
'npm ci'
,
{
stdio
:
'inherit'
}
)
;
}
}
console
.
log
(
'installed spa dependencies'
)
;
Back
|
FazBrowse Home
|
New Git URL