Skip to content

Commit

Permalink
October 19 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Qasim Khan committed Oct 19, 2023
1 parent a2e50e1 commit 21d42d1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,28 @@ To launch LAS for testing, run
npm run start
```

To update LAS, run
```
git pull
```

## Updates (bottom to top, top being latest and bottom being oldest)

### DISCLAIMER
The below list may not contain everything that was added, removed, changed, or fixed on the date specified. All changes can be seen in the files' "Blame" section.

This section will be removed when the first alpha is available.
This section will be removed when the first release is available.

### October 19, 2023
#### IMPORTANT NOTICE
This update marks the first packaged pre-release of LAS. New updates will be put into another branch.

#### Added
+ Extra steps are now performed during app installation, such as linking the `.desktop` file and changing permissions of executables.

### October 18, 2023
#### IMPORTANT NOTICE
This commit removes support for different sources. Now, LAS will get apps from the [Linux App Index](https://github.com/User8395/lai).
This update removes support for different sources. Now, LAS will get apps from the [Linux App Index](https://github.com/User8395/lai).

This has been done to reduce the complexity of managing multiple sources and mitigates some security risks.

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": "las",
"version": "0.0.0-prealpha",
"version": "0.1.0",
"description": "The Linux App Store",
"main": "./src/main.js",
"scripts": {
Expand Down
31 changes: 22 additions & 9 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const {
appendFileSync,
} = require("fs");
const { execSync } = require("child_process");
const { log } = require("console");
const homedir = require("os").homedir()
const lasdir = homedir + "/.las";

Expand Down Expand Up @@ -49,26 +50,29 @@ if (!existsSync(`${lasdir}`)) {
function info(val) {
// Information
console.log(`[Server/INFO] ${val}`);
appendFileSync(`${lasdir}/log.txt`, `INFO ${val}\n`);
appendFileSync(`${lasdir}/log.txt`, `[Server/INFO] ${val}\n`);
}
function warn(val) {
// Warning
console.warn(`[Server/WARN] ${val}`);
appendFileSync(`${lasdir}/log.txt`, `WARN ${val}\n`);
appendFileSync(`${lasdir}/log.txt`, `[Server/WARN] ${val}\n`);
}
function error(val) {
// Error
console.error(`[Server/ERROR] ${val}`);
appendFileSync(`${lasdir}/log.txt`, `ERROR ${val}\n`);
appendFileSync(`${lasdir}/log.txt`, `[Server/ERROR] ${val}\n`);
}

info("Starting LAS v0.1.0...");

// If the temp folder exists (usually stays after LAS is killed), delete it
if (existsSync(`${lasdir}/temp`)) {
info("Temp folder exists, clearing...");
rmSync(`${lasdir}/temp`, { recursive: true, force: true })
}

mkdirSync(`${lasdir}/temp`); // Create temp folder

info("Starting LAS v0.0.0...");
warn("============================= WARNING ================================");
warn("This is a development version of LAS.");
warn("Please report bugs on GitHub at https://github.com/User8395/las/issues");
warn("======================================================================");

// Function to download files using `wget`
function download(url) {
Expand Down Expand Up @@ -354,8 +358,18 @@ function createWindow() {
info(`${queue.install[i]} (${app.latestVersion}) ${i + 1}/${queue.install.length}`)
mkdirSync(`${lasdir}/apps/${queue.install[i]}`)
renameSync(`${lasdir}/temp/${queue.install[i]}/app.json`, `${lasdir}/apps/${queue.install[i]}/app.json`)
info("(1/3) Extracting files...")
execSync(`unzip ${lasdir}/temp/${queue.install[i]}.lapp.zip -d ${lasdir}/apps/${queue.install[i]}`)
info("(2/3) Linking desktop entry...")
execSync(`ln -fs ${lasdir}/apps/${queue.install[i]}/${app.desktopFile} ${homedir}/.local/share/applications/${app.desktopFile}`)
info("(3/3) Setting executable permissions...")
execSync(`chmod +x ${lasdir}/apps/${queue.install[i]}/${app.desktopFile}`)
for (let i2 = 0; i2 < app.executables.length; i2++) {
console.log(`[Server/DEBUG] ${app.executables[i]}`);
console.log(`[Server/DEBUG] ${lasdir}/apps/${queue.install[i]}/${app.executables[i]}`);
execSync(`chmod +x ${lasdir}/apps/${queue.install[i]}/${app.executables[i]}`)
}
info("Install complete")
}
installed.push(queue.install[i])
}
Expand All @@ -373,7 +387,6 @@ function createWindow() {

app.whenReady().then(() => {
// When LAS has loaded...
info("Creating window...");
createWindow(); // ...create the window

info("Started LAS");
Expand Down

0 comments on commit 21d42d1

Please sign in to comment.