Skip to content

Commit

Permalink
Gnome shell 45 support added ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulhaque committed Dec 29, 2023
1 parent 082b279 commit 9c1759b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"shell-version": [
"45"
],
"version": 6,
"version": 7,
"url": "https://github.com/rahulhaque/php-laravel-valet-gnome-shell-extension",
"settings-schema": "org.gnome.shell.extensions.php-laravel-valet"
}
1 change: 0 additions & 1 deletion stylesheet.css

This file was deleted.

7 changes: 3 additions & 4 deletions utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import GLib from 'gi://GLib';
import Bytes from 'gi://GLib/Bytes';

export function safeSpawn(cmd) {
try {
Expand All @@ -16,19 +15,19 @@ export function shellSpawn(cmd) {

export function phpVersion() {
const res = safeSpawn('/bin/bash -c "php -v | grep -Po \'PHP\\s+\\d+.\\d+(?:(.\\d+))?\'"');
if (res[3] == 0) return Bytes.toString(res[1]).replace(/\n$/, '');
if (res[3] == 0) return String.fromCharCode(...res[1]).replace(/\n$/, '');
return false;
}

export function phpList() {
const res = safeSpawn('ls /etc/php');
if (res[3] == 0) return Bytes.toString(res[1]).split('\n').filter(item => !!item).reverse();
if (res[3] == 0) return String.fromCharCode(...res[1]).split('\n').filter(item => !!item).reverse();
return false;
}

export function valetStatus() {
const res = safeSpawn('/bin/bash -c "valet --version && valet status"');
if (res[3] == 0) return Bytes.toString(res[1]).split('\n').filter(item => !!item);
if (res[3] == 0) return String.fromCharCode(...res[1]).split('\n').filter(item => !!item);
return false;
}

Expand Down

0 comments on commit 9c1759b

Please sign in to comment.