Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qlaffont committed Aug 22, 2017
1 parent 15f4aed commit ac44e7a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
3 changes: 0 additions & 3 deletions file-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ module.exports = {
},
set_config_file: function(data){
fs.writeFileSync(process.cwd() + "\\scripts.json", data);
},
remove_resource_folder: function(resourcename){

}
};
32 changes: 16 additions & 16 deletions index.js → fvm
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ if(arguments.length == 2){

promiseArray = [];

resourcestoinstall.forEach(resource => {
resourcestoinstall.forEach(function(resource){
if(resource == "--save"){
save = true;
}
});

//Can give multiple resources to install
resourcestoinstall.forEach(resource => {
resourcestoinstall.forEach(function(resource){
if(resource != "--save"){
if(tools.check_resource_format(resource)){
promiseArray.push(tools.download_resource(resource, dataConfigFile, save));
Expand All @@ -69,11 +69,11 @@ if(arguments.length == 2){
}
});

Promise.all(promiseArray).then(values => {
Promise.all(promiseArray).then(function(values) {
console.log("\n");

console.log(chalk.green("Installation Successful !"));
}).catch(data => {
}).catch(function(data) {
process.exit(0);
});

Expand All @@ -83,19 +83,19 @@ if(arguments.length == 2){

promiseArray = [];

Object.keys(dataConfigFile.resources).forEach(key => {
Object.keys(dataConfigFile.resources).forEach(function(key) {
var resource = key + "@" +dataConfigFile.resources[key];
if(tools.check_resource_format(resource)){
promiseArray.push(tools.download_resource(resource, dataConfigFile, save));
}
}
);

Promise.all(promiseArray).then(values => {
Promise.all(promiseArray).then(function(values) {
console.log("\n");

console.log(chalk.green("Installation Successful !"));
}).catch(data => {
}).catch(function(data) {
process.exit(0);
});
}
Expand All @@ -111,14 +111,14 @@ if(arguments.length == 2){

promiseArray = [];

resourcestoupdate.forEach(resource => {
resourcestoupdate.forEach(function(resource){
if(resource == "--save"){
save = true;
}
});

//Can give multiple resources to install
resourcestoupdate.forEach(resource => {
resourcestoupdate.forEach(function(resource){
if(resource != "--save"){
if(tools.check_resource_format(resource)){

Expand All @@ -131,23 +131,23 @@ if(arguments.length == 2){
}
});

Promise.all(promiseArray).then(values => {
Promise.all(promiseArray).then(function(values) {
console.log(chalk.green("Update Successful !"));
}).catch(data => {
}).catch(function(data) {
process.exit(0);
});
} else {
console.log("This package can be upgraded: "+"\n");

promiseArray = [];

Object.keys(dataConfigFile.resources).forEach(key => {
Object.keys(dataConfigFile.resources).forEach(function(key) {
promiseArray.push(tools.check_update_resource(key, dataConfigFile.resources[key]));
});

Promise.all(promiseArray).then(values => {
Promise.all(promiseArray).then(function(values) {
console.log("To upgrade packages, do " + chalk.green("fvm update <package_name>"));
}).catch(data => {
}).catch(function(data) {
process.exit(0);
});
}
Expand Down Expand Up @@ -178,14 +178,14 @@ if(arguments.length == 2){

promiseArray = [];

resourcestodelete.forEach(resource => {
resourcestodelete.forEach(function(resource){
if(resource == "--save"){
save = true;
}
});

//Can give multiple resources to install
resourcestodelete.forEach(resource => {
resourcestodelete.forEach(function(resource){
if(resource != "--save"){
if(tools.check_resource_format(resource)){
tools.deleteresource(resource, save, dataConfigFile)
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "fvm-installer",
"version": "1.0.0",
"version": "1.0.4",
"description": "Resource Installer for FiveM",
"main": "index.js",
"main": "./fvm",
"repository": {
"type": "git",
"url": "git+https://github.com/qlaffont/fvm-installer.git"
Expand All @@ -18,7 +18,14 @@
},
"homepage": "https://github.com/qlaffont/fvm-installer#readme",
"bin": {
"fvm": "./index.js"
"fvm": "./fvm"
},
"scripts": {
"fvm": "./fvm"
},
"preferGlobal": true,
"engines": {
"node": ">=0.12"
},
"dependencies": {
"adm-zip": "^0.4.7",
Expand Down

0 comments on commit ac44e7a

Please sign in to comment.