Giter Club home page Giter Club logo

tempest's Introduction

TEMPest

TEMPest is a tool to manage easily temporary folders/files

Build Status codecov Codacy Badge Go Report Card GoDoc apm Donate beta

Index

Installation

From source (Github)

Requirements

  • git
  • go (golang)

Command

First choose if you want to add permanantly GOBIN to your PATH

GOBIN temporarily in PATH
export GOBIN=/bin

or

export GOBIN=/usr/bin

You can also skip this step and then just add a symlink from $GOBIN/tempest to /usr/bin/tempest after the installation of TEMPest

Then

go get -v -u github.com/ChacaS0/tempest
GOBIN permanently in PATH

Add this line to /etc/environment:

GOBIN=<PATH_OF_YOUR_CHOICE>
PATH=$PATH:$GOBIN

Then

go get -v -u github.com/ChacaS0/tempest

Initialization

Command line init

It is very easy to use.
First, to initialize it the first time, run:

> tempest init

This will generate a .tempestcf file in $HOME/.tempest.

It will hold the list of all the targets.

If there is an issue and the file can't be created somehow, you can still create it at its default location: $HOME/.tempest/.tempestcf and leave it empty for now.

This will also generate a $HOME/.tempest/.tempest.yaml file. It will hold the configuration of TEMPest.

If there is an issue and the file can't be created somehow, you can still crate it at its default location: $HOME/.tempest/.tempest.yaml with default content:

duration: 5
auto-mode: false

Parameters:

  • duration : This is the maximum age the content of the target's content, choose it carefully!

You have to choose a duration greater than 1 !!

Add a new target to the list

To add the current directory

Positionate yourself to the deried directory. For example, if you want to add /tmp, use this instructions:

$ cd /temp
$ tempest add

With command-line

Just run:

tempest add ...<PATH>
  • <PATH> being the path to the directory to be added to the list of targets
  • ... meaning that many arguments can be passed

By convention we will give the name temp.est to the directories to be added to TEMPest

With a text editor

Just open $HOME/.tempest/.tempestcf and add a new line with the absolute path of the target to be added.

List the current directories added to TEMPest

Using TEMPest

$ tempest list

Viewing the file $HOME/.tempest/.tempestcf

$ cat $HOME/.tempest/.tempestcf
Or
$ vi $HOME/.tempest/.tempestcf

Updating TEMPest

$ tempest update

Runing a global purge

The age of the files deleted will be the one older than the number of days set as "duration" in $HOME/.tempest/.tempest.yaml

Test mode

In this mode, it will display the file it would delete plus the size.
Nothing gets deleted. To do so, try:

$ tempest start -t

Real one

Runing this will actually delete files/directories, make sure everything inside $HOME/.tempest/.tempestcf is meant to be there with TEMPest list first.

$ tempest start

Purging one directory

Still based on the config file

It is possible to purge a directory even if it is not added to TEMPest. There is also a test mode for this one.

Test mode

$ tempest purge -p <PATH> -t
  • <PATH> is the path you want to purge
  • -t declare the test mode

Real one

$ tempest purge -p <PATH>
  • <PATH> is the path you want to purge

Access the documentation (usage)

It is recommanded to have Showdown installed. If you don't but are interested, checkout this link.

$ tempest doc

There is also a "man like" view of the documentation.

$ tempest doc -m

More

If you want to know more about TEMPest, visit this page.


tempest's People

Contributors

chacas0 avatar muchchaca avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

tempest's Issues

tempest set -a X ::> wrong!

It turns something of the form:

{
    duration: W
}

into:

duration: X

Thus, the param duration is no more understood by TEMPest!

Tutorial

Intro

Develop a tutorial to show how to simply use TEMPest.

TODOs

  • Add a new target
  • Add many targets
  • List targets
  • Remove a target
  • Configuration
  • Init
  • start
  • test mode
  • help

Add if find more important stuff to show

Generate a new target

Gloablly

The ability to generate a new target in the current directory or in a specified one. This "new target" would be added automatically in the targets list of TEMPest and would already have the typed name referred in #31 like temp.est or whatever will be used there.

Usage

  • A new target in the current directory:
> tempest new
  • A new target in the /temp directory:
> tempest new /temp

TODOs

  • Actual code for the current directory
  • Tests for the current directory functionnality
  • Code for the named directory
  • Tests for the named directory functionnality

Improve ``rm`` command

In short

The tempest rm is a nice command but not so convenient to use. It just needs some enhancement.

Examples

We should be able to remove targets from the TEMPest list with a command like tempest rm -i 0-2 or tempest rm -i 0 3 or tempest -p /path1 /path2

In depth

So the 0-2 would remove all targets from 0 to 2 from TEMPest list.
0 3 would remove targets with index 0 and 3.
Should be able to do the same with the full path name.

In addition

Update and/or create documentation about that
โž• Use this opportunity to finish the --origin flag ๐Ÿ˜œ

TODOs

  • add the thing
  • write the code ofc
  • write doc
  • udpate tests
  • update rm tutorial (gh-pages)
  • same for --origin

Documentation

Keep them up to date:

  • helpers in README.md
  • index/menu in README.md
  • helpers in code

Add automatic mode to TEMPest

Presentation

Maybe by running tempest init, set an "automatic mode" "on" and stored in .tempest.yaml.

Thus, it would be possible to set it "on" or "off" with a flag from the command tempest set

"Automatic mode"

By automatic mode I mean that TEMPest would be run automatically, at start up for example.

TODOs

  • deactivate default test mode on the automode

Default config and set command

  • tempest always uses and prints that it is using default config file at [...].
  • tempest doesn't set corroctly the duration via the set command anymore

Back up configurations

Intro

Add a way to back up configurations stuff, including .tempestcf and ,tempest.yaml.

โ” Maybe using github? ๐Ÿ˜‘
โ” Maybe move the two config files into a config folder like ~/.tempest/.tempestcf and ~/.tempest/.tempest.yaml

๐Ÿ‘‰ Edit it or add comment to add some details

Add a way to fix broken paths

In short

When adding one or many paths to TEMPest, some might change or get deleted.

Details

A way to fix that would be to add a sub command or something, like :
tempest list fix
or
tempest list --fix

In depth

This command would check if every command still exist, if it doesn't, do something.
"Something" being deleting the path from TEMPest or asking the user to enter the new path for this one.
The new path would replace the old one in .tempestcf

In addition

Of course write some documentation and maybe complete README.md.

TODOs

  • add the thing
  • write the code ofc
  • write doc
  • write tests

Set command override

tempest set -a 4 for example deletes the config auto-mode, use merge or something instead?

Generate "man"

Try to generate man documentation, it should possible via viper or cobra.
If it's not out for the first beta version it's fine. ๐Ÿ™ˆ โ„๏ธ

Testing improvement

Write unit tests

For cmd package:

  • add.go
  • get.go
  • init.go
  • list.go
  • rm.go
  • set.go
  • start.go
  • purge.go
  • update.go
  • version.go
  • doc.go
  • root.go

This might even get followed by a new command like tempest debug or something to see what's wrong. In that case a new issue or task will be created.

After temp directories, temp files?

Suggestion

The only "targets" of TEMPest for now, are directories... We can do more!
TEMPest should be able to "empty" temporary files pointed as "targets".

TODOs

  • add the working command(s) required for this to work
  • write the doc ( README.md + help flags )
  • unit tests
  • runtime test
  • gh-pages

Auto add temp.est directories

Globally

Look for all temp.est directories of the system and add them to the targets list of TEMPest if they are not already there.

Usage

Should be something like:

> tempest add --auto

Then maybe display a little warning message about the time it would take and to confirm ?
At the end, shows what targets were added.

TODOs

  • Actual code that would search those directories.
  • Tests for the research.
  • Code to add the matching directories
  • Tests for the add.

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.