Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
74 Legacy V3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
insert
74 Legacy V3
Commits
446b5b76
Commit
446b5b76
authored
Jul 07, 2018
by
insert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically installs dependencies from npm
parent
dead5522
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
952 additions
and
5 deletions
+952
-5
core/fortnite/index.js
core/fortnite/index.js
+1
-3
core/index.js
core/index.js
+28
-2
core/package-lock.json
core/package-lock.json
+923
-0
No files found.
core/fortnite/index.js
View file @
446b5b76
...
...
@@ -4,9 +4,7 @@ let fortniteAPI = new Fortnite([
"
kerchow74
"
,
"
MzRhMDJjZjhmNDQxNGUyOWIxNTkyMTg3NmRhMzZmOWE6ZGFhZmJjY2M3Mzc3NDUwMzlkZmZlNTNkOTRmYzc2Y2Y=
"
,
"
ZWM2ODRiOGM2ODdmNDc5ZmFkZWEzY2IyYWQ4M2Y1YzY6ZTFmMzFjMjExZjI4NDEzMTg2MjYyZDM3YTEzZmM4NGQ=
"
],
{
debug
:
true
});
]);
let
connected
=
false
;
...
...
core/index.js
View file @
446b5b76
const
fs
=
require
(
'
fs
'
);
const
child_process
=
require
(
'
child_process
'
);
const
path
=
require
(
'
path
'
);
var
modules
=
{};
var
commands
=
{};
...
...
@@ -47,11 +49,13 @@ let index = path => {
};
core
.
reload
=
()
=>
{
console
.
log
(
"
[INFO] Reloading...
"
);
commands
=
{};
modules
=
{};
let
mods
=
fs
.
readdirSync
(
'
./core
'
);
let
modules_missing
=
[];
mods
.
forEach
(
mod
=>
{
if
(
mod
==
'
index.js
'
)
return
;
if
(
mod
==
'
index.js
'
||
mod
==
'
node_modules
'
||
mod
==
'
package-lock.json
'
)
return
;
try
{
let
path
=
`
./core/
${
mod
}
/
`
;
let
cmds
=
fs
.
readdirSync
(
path
);
...
...
@@ -74,9 +78,31 @@ core.reload = () => {
},
i
.
commands
[
n
]);
});
}
catch
(
e
)
{
console
.
error
(
'
[WARN] Failed to load module,
'
+
mod
+
'
!
'
);
console
.
error
(
'
[WARN] Failed to load module,
'
+
mod
+
'
with error:
'
+
e
);
if
((
''
+
e
).
includes
(
'
Cannot find module
'
))
{
let
module
=
/Error: Cannot find module '
(
.+
?)
'/
.
exec
((
''
+
e
))[
1
];
console
.
log
(
'
[WARN] Node module missing,
'
+
module
+
'
!
'
);
modules_missing
.
push
(
module
);
}
}
});
if
(
modules_missing
.
length
==
0
)
return
;
console
.
log
(
"
[INFO] Several modules are missing, installing them in 5 seconds! Exit if you do not want to proceed.
"
);
setTimeout
(()
=>
{
modules_missing
.
forEach
(
module
=>
{
try
{
let
res
=
child_process
.
execSync
(
'
npm i
'
+
module
,
{
cwd
:
path
.
resolve
(
__dirname
)
});
console
.
log
(
res
);
}
catch
(
e
)
{
console
.
log
(
'
[WARN] Failed to install node module:
'
+
module
+
'
!
'
);
}
});
core
.
reload
();
},
5
e3
);
};
if
(
!
fs
.
existsSync
(
'
./core/node_modules
'
))
fs
.
mkdirSync
(
'
./core/node_modules
'
);
core
.
reload
();
\ No newline at end of file
core/package-lock.json
0 → 100644
View file @
446b5b76
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment