Skip to content

Commit

Permalink
Fix for release not site directories
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniele Sabre committed Nov 10, 2021
1 parent 561b6cc commit 1b06723
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Build and deploy a nodejs application (such as React, Angular, Vue ecc...).

From version 1.1.0, using `DSDEPLOY_FTP_PREDEPLOY` variable, you can deploy anything, even not a site.
From version 1.1.2, using `DSDEPLOY_FTP_PREDEPLOY` variable, you can deploy anything, even not a site.


## Configuration
Expand Down
9 changes: 7 additions & 2 deletions bin/deploy-ftp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@ const {execSync} = require("child_process");
const FtpDeploy = require("ftp-deploy");
const ftpDeploy = new FtpDeploy();
const cwd = process.cwd();
const projectJson = require(cwd + '/package.json');
const deployJson = require('../package.json');
const envFilename = process.argv[2] || '.env.local';

// load configuration from .env.local file
require('dotenv').config({path: cwd + '/' + envFilename});

console.log(chalk.bgMagenta(chalk.black(`- ${deployJson.name} version: ${deployJson.version} -`)));
console.log(chalk.bgYellow(chalk.black(`DEPLOY PROJECT ${projectJson.name}`)));

// if the project is a nodejs project, show a subtitle
try {
const projectJson = require(cwd + '/package.json');
console.log(chalk.bgYellow(chalk.black(`DEPLOY PROJECT ${projectJson.name}`)));
} catch (err) {
}

// check if configuration is defined
if (!process.env.DSDEPLOY_FTP_USER || !process.env.DSDEPLOY_FTP_HOST) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dsabre/deploy-ftp",
"version": "1.1.1",
"version": "1.1.2",
"description": "Build and deploy a builded nodejs application (such as React, Angular, Vue ecc...).",
"bin": {
"@dsabre/deploy-ftp": "bin/deploy-ftp.js"
Expand Down

0 comments on commit 1b06723

Please sign in to comment.