Code Monkey home page Code Monkey logo

devenv's Introduction

devenv

An application for settung up new projects/environments based on templates.

/files contains some example templates to poke at.

Purpose

The purpose of this project is to help with the initial setup of a new project. Like creating templated CI/CD pipelines for testing/linting/whatever, base Dockerfiles, Justfiles or Makefiles, etc.

Installation

cargo install devenv

Or, if you wish to use the latest build, cargo install --git https://github.com/lyssieth/devenv.git

Usage

The root of all commands is

devenv

On first run, it will create a default configuration file in its directory.

The default language is any (-l <language>) and the platform is any (-p <platform>).
Both of which need to exist in the configuration file under their respective headings in order to function, however those two exist as defaults in the generated config file.

any is a hard-coded wildcard and will is always a valid language/platform. However, one does need to have a template file for any added via devenv create.

Note: All arguments are case-sensitive (for now)

devenv create

This creates new template files for usage with devenv generate.

As an example, creating a template Dockerfile.

devenv create docker ./Dockerfile
# This creates a new template Dockerfile for `any` language projects for the `any` platform.
# However, a more likely use case is:
devenv -l rust create docker ./Dockerfile
# Which creates a template Dockerfile for `rust` projects on `any` platform.

Templates can currently contain the following placeholders:

  • {ProjectName}: The name of the project (essentially the current working directory, however in the future maybe the name of the git repo or topmost directory that's a git repo)
  • {ProjectName_DashesToUnderscores}: The name of the project with dashes replaced with underscores
  • {ProjectName_Lowercase}: The name of the project with all characters lowercase

devenv generate

This generates a file based on an existing template.

As an example, generating a Dockerfile for a rust language project.

devenv -l rust generate docker

If the template is:

FROM rust:latest

WORKDIR /{ProjectName}

COPY . .

CMD [ "cargo", "run", "--release" ]

Then the output file, assuming the project name is rust-project:

FROM rust:latest

WORKDIR /rust-project

COPY . .

CMD [ "cargo", "run", "--release" ]

Written to a file called Dockerfile

devenv config

This is mostly for debug reasons, however it can be helpful.

devenv config path

This will print the path to the configuration file.

$ devenv config path
/home/user/.config/devenv/config.yml

devenv config regenerate

This will regenerate the configuration file, using the default defined in config.rs

devenv config show

This prints out the current config file as a pretty-printed Rust struct.

Problems

  • It's probably got bugs. I haven't tested it much. It works in my use-case, and I haven't had reason to test it.

devenv's People

Contributors

lyssieth avatar

Stargazers

 avatar

Watchers

 avatar  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.