Coder Social home page Coder Social logo

inscripoem / hustmirror-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hust-open-atom-club/hustmirror-cli

0.0 0.0 0.0 107 KB

hustmirror-cli 帮助快速换源

Home Page: https://mirrors.hust.edu.cn/docs/

License: MIT License

Shell 92.76% Python 4.43% Makefile 2.80%

hustmirror-cli's Introduction

hustmirror-cli

Introduction

hustmirror-cli is a CLI posix shell script to replace system repository mirror to HUST Mirror.

Supported Linux Distributions and Software

  • Alpine Linux
  • Anolis OS
  • Arch Linux
  • Black Arch
  • crates
  • Debian
  • Deepin
  • Kali
  • LinuxMint
  • openEuler
  • openKylin
  • pypi
  • Rustup
  • Ubuntu
  • Oh My Zsh

If you would to request supports of new Linux distributions or software, please submit an issue.

Usage

curl -s https://mirrors.hust.edu.cn/get | sh -s -- autodeploy

See details about hustmirror-cli usage in the USAGE.md.

Build

Use GNU make to process all files and generate them into a single executable bash.

make

The output script will be placed in ./output/hustmirror-cli

Test

make test

Contract

Styles

  • Syntax of scripts is supposed to POSIX shell compatible.
  • Use 4 character tab indent.
  • We suppose that user only install GNU coreutils or busybox. So prerequisite check is supposed to be made when use other utils like gcc or make.

Directories

  • src: scripts would packaging into output scripts.
    • src/mirrors: scripts subject to mirror script contract.
    • src/main.sh.template: template shell file.
    • src/checkfile.sh: check file.
  • scripts: store scripts used for packaging.

Template

Template file supports following directives:

  • @include file: include other files.
  • @var(shell code): get a string from build process.
  • @mirrors: include all processed mirror scripts.

Mirror script contract

All files in mirror should implement following functions.

  • check: (optional) check if target machine is satisfied to replace mirror.
  • install: install mirror.
  • is_deployed: (optional) check whether is deployed.
  • can_recover: (optional) check whether can be recovered.
  • uninstall: (optional) recover installation.

hustmirror-cli's People

Contributors

jxlpzqc avatar mudongliang avatar jingfelix avatar tttturtle-russ avatar sophietwilight avatar hustliuhaoyi avatar earthcompass avatar

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.