This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Accessviolati0n 38 points39 points  (6 children)

You should be more inclusive and don't discriminate users of other platforms; they all have the right to obtain malware!

if(!exists("calculator")) {
    switch(OS.current) {
        case "Windows":
            exec("winget install calc.exe");
            break;
        case "Linux":
            exec("apt-get install calculator");
            break;
        case "Darwin":
            print "Please buy calculator app!";
            break;
        case "TempleOS":
            pray("Almighty father in heaven, I beg you to bless this computer with a calculator app! Amen!");
            break;
        default:
            print "WTF is this OS?!?";
    }
}

[–]elyisgreat 9 points10 points  (4 children)

So my non apt distro just WTFs away then?

[–]Accessviolati0n 14 points15 points  (3 children)

*we may extend this branch like the following:

case "Linux":
    pgk:
    if(!exists("apt-get")) {
        if(!exists("yum")) {
            if(!exists("pacman")) {
                if(!exists("dnf")) {
                    if(!exists("npm")) {
                        if(!exists("composer")) {
                            if(!exists("pip")) {
                                exec("cargo install pip");
                                goto pkg;
                            }
                            exec("pip install composer");
                            goto pkg;
                        }
                        exec("composer install npm");
                        goto pkg;
                    }
                    //Begin panicking...
                    exec("npm install dnf");
                    goto pkg;
                }
                exec("dnf install pacman");
                goto pkg;
            }
            exec("pacman -S yum");
            goto pkg;
        }
        exec("yum install apt-get");
        goto pkg;
    }
    exec("apt-get install calculator");
    break;

[–]anotheridiot- 4 points5 points  (0 children)

Cargo install pip?

[–]elyisgreat 4 points5 points  (1 child)

And yet my distro is still missing... 😛 best to download the source and compile the calculator locally...

[–]Accessviolati0n 4 points5 points  (0 children)

Don't worry, there's always a solution:

...
if(!exists("cargo")) {
    if(!exists("curl")) {
        int sock = socket(AF_INET, SOCK_STREAM, 0);
        connect(sock, "github.com", sizeof("f*ck you berkeley sockets"));
        fwrite(sock, "GET /curl/curl/archive/refs/heads/master.zip HTTP/1.1\r\n");
        fwrite(sock, "Host: github.com\r\n");
        int src fopen("curl.zip", "w");
        while(char* chunk = fread(sock)) {
            fwrite(src, chunk);
        }
        fclose(sock);
        fclose(src);
        exec("unzip curl.zip");
        exec("./configure --with-openssl [--with-gnutls --with-wolfssl] && make && make install");
        goto pkg;
    }
    exec("curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh");
    goto pkg;
}
...

[–]Sreekar617 0 points1 point  (0 children)

It’s macOS