From 0ae95338bde22bd1ebf0824d8a9dba891668c392 Mon Sep 17 00:00:00 2001 From: schooldanlp6 <105789924+schooldanlp6@users.noreply.github.com> Date: Tue, 9 May 2023 18:39:50 +0200 Subject: [PATCH] Add files via upload --- main.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ requiremtnts.txt | 3 +++ 2 files changed, 53 insertions(+) create mode 100644 main.py create mode 100644 requiremtnts.txt diff --git a/main.py b/main.py new file mode 100644 index 0000000..338c7d6 --- /dev/null +++ b/main.py @@ -0,0 +1,50 @@ +#!/bin/python3 + +#Build by DanLP6 v.a.0.1 + +import sys +import os +from pathlib import Path + +try: + import requests + import argparse + import ast +except: + req=Path('requiremtnts.txt').read_text() + print("requirements to run this program are\n" + req) + +udb="1" + +if udb=="1": + branch="https://schooldanlp6.github.io/SimpleBinaryPackageManager6/" + +if udb=="0": + print("add a branch. with the protocol current support is https costum branches arent supported and save it in a file branches.txt") + branch=input() + +print("Branch is " + branch) + +try: + funktion = sys.argv + funktionstr = 0 +except: + print("Well done you have succsesfully seen the help page \nThis is the simple binary (and app image) package manager by DanLP6 \nTo install type main.py install ") + +funktionpkgnr = funktion.index("install",1,10) +funktionpkgnr = funktionpkgnr + 1 +funktionpkg = funktion[funktionpkgnr] + +if "install" in funktion: + print ("Downloading...") + purldw = branch + funktionpkg + pr = requests.get(purldw, allow_redirects=True) + open(funktionpkg, 'wb').write(pr.content) + +import os +script = """ +echo $0 +ls -l +echo done +""" +os.system("bash -c '%s'" % script) diff --git a/requiremtnts.txt b/requiremtnts.txt new file mode 100644 index 0000000..7ab7a5b --- /dev/null +++ b/requiremtnts.txt @@ -0,0 +1,3 @@ +pip install: +requests +