Skip to content
/ pypre Public

An npm binary package for preconfiguring files using placeholder syntax.

License

Notifications You must be signed in to change notification settings

ihiiro/pypre

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pypre v3.0.0

pypre is an npm binary package for preconfiguring files.

install

npm install -g pypre

usage

create package.json file in the directory where you have files to preconfigure:

npm init -y

go to the root of your project and run :

npm link

then back to the child directory, run:

npm link [name-of-your-parent-project]

navigate to the directory where you have files you want to preconfigure and create a single .pypre.json file containing the keys:

{
  "filename": "yourfilename",
  "vars": {
    "var1": "value1",
    "var2": "value2",
    ...
  }
}

add a [yourfilename].preconfig.[some-extension] file, with the following placeholders whereever you need them

$preconfigure_[here include the name of your placeholder, without the brackets and only letters]$

in the child package.json add:

"scripts": {
  "pypre": "pypre && python3 pypre.py && rm pypre.py"
}

run pypre where [yourfilename].preconfig.[some-extension] is

npm run pypre

this should generate a configured file with the name specified in your .pypre.json and placeholders filled in

About

An npm binary package for preconfiguring files using placeholder syntax.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published