Skip to content

Commit 1b06723

Browse files
author
Daniele Sabre
committed
Fix for release not site directories
1 parent 561b6cc commit 1b06723

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

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

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

1313

1414
## Configuration

bin/deploy-ftp.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ const {execSync} = require("child_process");
66
const FtpDeploy = require("ftp-deploy");
77
const ftpDeploy = new FtpDeploy();
88
const cwd = process.cwd();
9-
const projectJson = require(cwd + '/package.json');
109
const deployJson = require('../package.json');
1110
const envFilename = process.argv[2] || '.env.local';
1211

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

1615
console.log(chalk.bgMagenta(chalk.black(`- ${deployJson.name} version: ${deployJson.version} -`)));
17-
console.log(chalk.bgYellow(chalk.black(`DEPLOY PROJECT ${projectJson.name}`)));
16+
17+
// if the project is a nodejs project, show a subtitle
18+
try {
19+
const projectJson = require(cwd + '/package.json');
20+
console.log(chalk.bgYellow(chalk.black(`DEPLOY PROJECT ${projectJson.name}`)));
21+
} catch (err) {
22+
}
1823

1924
// check if configuration is defined
2025
if (!process.env.DSDEPLOY_FTP_USER || !process.env.DSDEPLOY_FTP_HOST) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dsabre/deploy-ftp",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Build and deploy a builded nodejs application (such as React, Angular, Vue ecc...).",
55
"bin": {
66
"@dsabre/deploy-ftp": "bin/deploy-ftp.js"

0 commit comments

Comments
 (0)