GithubHelp home page GithubHelp logo

denisebitca / ftpkg_cli Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 55 KB

Terminal utility to install packages curated by the 42 Paris staff on 42 dumps

License: GNU General Public License v3.0

Dockerfile 2.37% Shell 97.63%
42 42born2code 42paris cli ftpkg

ftpkg_cli's Introduction

Disclaimer

I barely use Github for ethical reasons. It's here for contributing to Github projects and because every third job application asks me for my Github page. Most of what I do is over at my Sourcehut page or the Miaoute + Gitea Miaoute profile.

You should consider pulling your projects out of Github.

Attention

J'utilise peu Github pour des raisons éthiques. Ce compte existe pour contribuer aux projets sur Github et parce que les recruteurs demandent une page Github. La plupart de ce que je fais est sur ma page Sourcehut or le profil de la miaoute sur Miaoute + Gitea.

Tu devrais considérer enlever tes projets de Github.

ftpkg_cli's People

Contributors

denisebitca avatar

Stargazers

 avatar

Watchers

 avatar

ftpkg_cli's Issues

Workaround for failing Flatpak runs through ftpkg_cli

Flatpak seems to be failing extremely often on 42Paris dumps. I'm running a workaround on my session which looks like this.

#!/bin/bash

PACKAGE_NAME="io.neovim.nvim"
EXEC_NAME="nvim"

LIB_LOCATION="/var/lib/flatpak/app/$PACKAGE_NAME/current/active/files/lib"
EXEC_LOCATION="/var/lib/flatpak/app/$PACKAGE_NAME/current/active/files/bin"
PATH="$EXEC_LOCATION:$PATH"
LD_LIBRARY_PATH=$LIB_LOCATION $EXEC_LOCATION/$EXEC_NAME $@

Would be interesting, upon install, for ftpkg_cli to automatically create a file in ~/.local/bin for everything it installs.
Would allow to circumvent issues with Flatpak.

Support for password caching

Since the code constantly does docker-compose build followed by docker-compose run, it would be interesting to keep the password somewhere so that we don't need to load Docker all the time, just once.

Error handling inside the "query" option is non-existant

Whenever the upstream server is failing with a 404 or a 500, the query option doesn't warn the user at all. Instead, it shows this.

[not installed] 
        Package name: 
        Version: 
        Description: 

/tmp/ftpkg_1678786789 (END)

Would be kinder to leave a message of the sort, much like with install and uninstall options:

ftpkg_cli v0.3 - terminal utility for installing curated Flatpak packages by the 42 Paris team on 42 Paris dumps
Copyright (C) 2023 Denise BITCA 
This program comes with ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to redistribute it under certain conditions; see LICENSE file for more.

[FAIL] - here are more details:
(...)

Running ftpkg_cli outside of its directory yields a "No such file or directory" error

On run of any ftpkg_cli subcommands, if ftpkg_cli is not run in its own directory, ftpkg_cli returns something like this:

$ ftpkg_cli -q 
ftpkg_cli v0.1 - terminal utility for installing curated Flatpak packages by the 42 Paris team on 42 Paris dumps
Copyright (C) 2023 Denise BITCA 
This program comes with ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to redistribute it under certain conditions; see LICENSE file for more.

/mnt/nfs/homes/rbitca/bin/ftpkg_cli: line 161: ./ftpkg_cli_query_parse.sh: No such file or directory

Fix
Adding cd "$(dirname "$0")" at the start of ftpkg_cli and removing relative access from code, using $PWD instead.

Dumps that do not have "docker compose" cannot install or uninstall anything

If the machine has a separate docker-compose command, ftpkg_cli fails.

$> ftpkg_cli --install io.neovim.nvim
ftpkg_cli v0.1 - terminal utility for installing curated Flatpak packages by the 42 Paris team on 42 Paris dumps
Copyright (C) 2023 Denise BITCA 
This program comes with ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to redistribute it under certain conditions; see LICENSE file for more.

[INFO] - Running Docker to get the required ftpkg password. This can take a little bit of time. Especially on Mac dumps.
unknown shorthand flag: 'f' in -f
See 'docker --help'.

Usage:  docker [OPTIONS] COMMAND

(...)

Workaround:

None found yet

Longterm solutions are possible:

  • Run a Dockerfile rather than docker-compose
  • Auto-detect if "docker compose" is available or not and adjust accordingly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.