Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7112756
cli.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
cli.js
View Options
#!/usr/bin/env node
import
{
execSync
}
from
"child_process"
;
import
{
setRepoName
}
from
"./utils/setRepoName.js"
;
function
runCommand
(
command
)
{
try
{
execSync
(
`
${
command
}
`
,
{
stdio
:
"inherit"
});
}
catch
(
e
)
{
console
.
error
(
`Failed to execute
${
command
}
`
,
e
);
return
false
;
}
return
true
;
}
const
repoName
=
"Sealcode-module"
;
const
newRepoName
=
(
await
setRepoName
())
||
"Sealcode-module"
;
console
.
log
(
`Directory created: '
${
newRepoName
}
'`
);
const
repoPath
=
`https://hub.sealcode.org/source/module-starter.git '
${
newRepoName
}
'`
;
const
gitCheckout
=
`git clone --depth 1
${
repoPath
}
`
;
const
installDependencies
=
`cd '
${
newRepoName
}
' && npm install`
;
console
.
log
(
`Cloning of the repository '
${
repoName
}
' in process...`
);
const
checkedOut
=
runCommand
(
gitCheckout
);
if
(
!
checkedOut
)
process
.
exit
(
-
1
);
console
.
log
(
`Installing dependencies for '
${
newRepoName
}
'`
);
const
installedDependencies
=
runCommand
(
installDependencies
);
if
(
!
installedDependencies
)
process
.
exit
(
-
1
);
console
.
log
(
"Installation completed! Check the README file for additional steps."
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 4, 04:06 (12 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
799782
Default Alt Text
cli.js (1 KB)
Attached To
Mode
rCSM create-sealcode-module
Attached
Detach File
Event Timeline
Log In to Comment