oraksoft-node-tools 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env CHANGED
@@ -11,5 +11,5 @@ osf_ftp_host=ftp.example.com
11
11
  osf_ftp_user=username
12
12
  osf_ftp_password=password
13
13
  osf_ftp_secure=false
14
- #osf_local_file=deployphp25.tar.gz
15
- osf_remote_file=/public_html/deploy.tar.gz
14
+ osf_local_file=deployphp25.tar.gz
15
+ osf_remote_path=/public_html
package/README.md CHANGED
@@ -96,10 +96,11 @@ osf_ftp_user=username
96
96
  osf_ftp_password=password
97
97
  osf_ftp_secure=false
98
98
  osf_local_file=orak-deploy-zip.tar.gz
99
- osf_remote_file=/path/to/remote/file.tar.gz
99
+ osf_remote_path=/public_html
100
100
  ```
101
101
 
102
102
  - `osf_local_file` belirtilmezse, `orak-config.json`'daki `fiDeployZipFile` değeri kullanılır
103
+ - `osf_remote_path` uzak sunucudaki hedef klasör yolunu belirtir, dosya adı otomatik olarak `osf_local_file`'dan alınır
103
104
 
104
105
  **❗ Güvenlik Notları:**
105
106
  - `.env` dosyası zaten .gitignore'da bulunuyor
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  import { envDevChange } from '../lib/env-dev-change.js';
4
4
 
package/lib/deploy-ftp.js CHANGED
@@ -22,17 +22,6 @@ export async function deployFtp() {
22
22
 
23
23
  const projectRoot = process.cwd();
24
24
 
25
- // orak-config.json dosyasını oku
26
- const configPath = path.join(projectRoot, 'orak-config.json');
27
- let deployZipFile = 'deploy';
28
-
29
- if (fs.existsSync(configPath)) {
30
- const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
31
- if (config.fiDeployZipFile) {
32
- deployZipFile = config.fiDeployZipFile;
33
- }
34
- }
35
-
36
25
  // .env dosyasını oku
37
26
  const envPath = path.join(projectRoot, '.env');
38
27
 
@@ -45,8 +34,8 @@ osf_ftp_host=ftp.example.com
45
34
  osf_ftp_user=username
46
35
  osf_ftp_password=password
47
36
  osf_ftp_secure=false
48
- osf_local_file=${deployZipFile}.tar.gz
49
- osf_remote_file=/path/to/remote/file.tar.gz
37
+ osf_local_file=deploy.tar.gz
38
+ osf_remote_path=/public_html
50
39
  `);
51
40
  process.exit(1);
52
41
  }
@@ -69,10 +58,11 @@ osf_remote_file=/path/to/remote/file.tar.gz
69
58
  const ftpUser = envVars.osf_ftp_user;
70
59
  const ftpPassword = envVars.osf_ftp_password;
71
60
  const ftpSecure = envVars.osf_ftp_secure === 'true';
72
- const localFileName = envVars.osf_local_file || `${deployZipFile}.tar.gz`;
73
- const remoteFilePath1 = envVars.osf_remote_file;
61
+ const localFileName = envVars.osf_local_file || 'deploy.tar.gz';
62
+ const remotePath = envVars.osf_remote_path || '/';
74
63
 
75
64
  let localFilePath1 = path.join(projectRoot, "dist", localFileName);
65
+ let remoteFilePath1 = path.posix.join(remotePath, localFileName);
76
66
 
77
67
  if (!ftpHost || !ftpUser || !ftpPassword) {
78
68
  console.error("Error: FTP bilgileri eksik. .env.oraksoft dosyasında osf_ftp_host, osf_ftp_user ve osf_ftp_password alanlarını kontrol edin.");
package/lib/deploy-zip.js CHANGED
@@ -23,6 +23,29 @@ export async function deployZip() {
23
23
  // Çalışma dizinini tespit et (komutun çalıştırıldığı yer)
24
24
  const projectRoot = process.cwd();
25
25
 
26
+ // .env dosyasını oku
27
+ const envPath = path.join(projectRoot, '.env');
28
+ let archiveName = 'deploy.tar.gz';
29
+
30
+ if (fs.existsSync(envPath)) {
31
+ const envContent = fs.readFileSync(envPath, 'utf-8');
32
+ const envVars = {};
33
+
34
+ envContent.split('\n').forEach(line => {
35
+ const trimmedLine = line.trim();
36
+ if (trimmedLine && !trimmedLine.startsWith('#')) {
37
+ const [key, ...valueParts] = trimmedLine.split('=');
38
+ if (key && valueParts.length > 0) {
39
+ envVars[key.trim()] = valueParts.join('=').trim();
40
+ }
41
+ }
42
+ });
43
+
44
+ if (envVars.osf_local_file) {
45
+ archiveName = envVars.osf_local_file;
46
+ }
47
+ }
48
+
26
49
  // orak-config.json dosyasını oku
27
50
  const configPath = path.join(projectRoot, 'orak-config.json');
28
51
 
@@ -42,7 +65,6 @@ export async function deployZip() {
42
65
 
43
66
  // dist klasörü ve arşiv adı
44
67
  const distDir = path.resolve(projectRoot, 'dist');
45
- const archiveName = config.fiDeployZipFile ? `${config.fiDeployZipFile}.tar.gz` : 'deploy.tar.gz';
46
68
  const archivePath = path.join(distDir, archiveName);
47
69
 
48
70
  // dist klasörü yoksa oluştur
package/orak-config.json CHANGED
@@ -7,7 +7,6 @@
7
7
  ],
8
8
  "copyDepsLibFolder": "lib",
9
9
  "copyDepsLibFolderEmpty": true,
10
- "fiDeployZipFile": "orak-deploy-zip",
11
10
  "fiDeployZipContent": [
12
11
  "src/",
13
12
  "public/",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oraksoft-node-tools",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "CLI araçları koleksiyonu - orak-copy-deps, orak-deploy-ftp, orak-deploy-zip, orak-env-change ve orak-env-dev-change komutları",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",