mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-08 21:34:25 +00:00
chore: manage the repo with task, improve on taskfile
This commit is contained in:
21
Makefile
21
Makefile
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env make
|
||||
|
||||
override venv ?= ${shell git rev-parse --show-toplevel}/.venv
|
||||
|
||||
create-venv: override python_version ?= 3.11
|
||||
ifeq "${shell uname}" "Darwin"
|
||||
create-venv: python_executable = ${shell which 'python${python_version}'}
|
||||
else
|
||||
create-venv: python_executable = ${shell which --tty-only --show-dot --show-tilde 'python${python_version}'}
|
||||
endif
|
||||
create-venv: ${python_executable}
|
||||
@${python_executable} -m 'venv' '${venv}'
|
||||
@${venv}/bin/pip --require-virtualenv install -r 'requirements.txt'
|
||||
|
||||
recreate-venv:
|
||||
@rm -rf '${venv}'
|
||||
@${MAKE} create-venv
|
||||
|
||||
update-venv: ${venv}/bin/pip
|
||||
@${venv}/bin/pip freeze -l --require-virtualenv | sed 's/==/>=/' \
|
||||
| xargs ${venv}/bin/pip --require-virtualenv install -U
|
||||
27
Taskfile.yml
27
Taskfile.yml
@@ -7,18 +7,29 @@ vars:
|
||||
|
||||
tasks:
|
||||
|
||||
create-venv:
|
||||
dev-tools:bootstrap:
|
||||
cmds:
|
||||
- python3.12 -m 'venv' '{{.VENV_DIR}}'
|
||||
- >-
|
||||
{{.VENV_DIR}}/bin/pip --require-virtualenv install -r '{{.REQUIREMENTS_FILE}}'
|
||||
- task: python:create-venv
|
||||
- npm install
|
||||
|
||||
recreate-venv:
|
||||
dev-tools:update:
|
||||
cmds:
|
||||
- rm -rf '{{.VENV_DIR}}'
|
||||
- task: create-venv
|
||||
- task: python:update-venv
|
||||
- npm update --save
|
||||
|
||||
update-venv:
|
||||
python:create-venv:
|
||||
vars:
|
||||
PYTHON_VERSION: 3.12
|
||||
cmds:
|
||||
- "python{{.PYTHON_VERSION}} -m 'venv' '{{.VENV_DIR}}'"
|
||||
- "{{.VENV_DIR}}/bin/pip --require-virtualenv install -r '{{.REQUIREMENTS_FILE}}'"
|
||||
|
||||
python:recreate-venv:
|
||||
cmds:
|
||||
- "rm -rf '{{.VENV_DIR}}'"
|
||||
- task: python:create-venv
|
||||
|
||||
python:update-venv:
|
||||
cmd: >-
|
||||
{{.VENV_DIR}}/bin/pip freeze -l --require-virtualenv | sed 's/==/>=/'
|
||||
| xargs {{.VENV_DIR}}/bin/pip --require-virtualenv install -U
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
# Node Package Manager CLI
|
||||
|
||||
## Table of contents <!-- omit in toc -->
|
||||
|
||||
1. [TL;DR](#tldr)
|
||||
1. [Further readings](#further-readings)
|
||||
|
||||
## TL;DR
|
||||
|
||||
<details>
|
||||
<summary>Setup</summary>
|
||||
|
||||
```sh
|
||||
# Disable SSL verification.
|
||||
npm config set 'strict-ssl'='false'
|
||||
|
||||
# Use custom CA certificates.
|
||||
npm config set 'cafile'='path/to/ca/cert.pem'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Usage</summary>
|
||||
|
||||
```sh
|
||||
# Search for packages.
|
||||
npm search 'typescript'
|
||||
@@ -22,17 +36,15 @@ npm i -g '@pnp/cli-microsoft365@latest'
|
||||
npm clean-install '@pnp/cli-microsoft365'
|
||||
npm ci -g '@pnp/cli-microsoft365@latest'
|
||||
|
||||
# Update packages.
|
||||
npm update
|
||||
npm up --save
|
||||
|
||||
# Remove packages.
|
||||
npm uninstall '@pnp/cli-microsoft365'
|
||||
```
|
||||
|
||||
```sh
|
||||
# Disable SSL verification.
|
||||
npm config set 'strict-ssl'='false'
|
||||
|
||||
# Use a custom CA certificate.
|
||||
npm config set 'cafile'='path/to/ca/cert.pem'
|
||||
```
|
||||
</details>
|
||||
|
||||
## Further readings
|
||||
|
||||
|
||||
@@ -37,8 +37,9 @@ Cons:
|
||||
# Install the executable.
|
||||
brew install 'go-task'
|
||||
choco install 'go-task'
|
||||
sudo dnf install 'go-task'
|
||||
sudo snap install 'task' --classic
|
||||
dnf install 'go-task'
|
||||
snap install 'task' --classic
|
||||
zypper install 'https://github.com/go-task/task/releases/download/v3.39.2/task_linux_amd64.rpm'
|
||||
|
||||
# Setup the shell's completion.
|
||||
task --completion 'fish' > ~/'.config/fish/completions/task.fish'
|
||||
@@ -72,6 +73,7 @@ task --completion 'bash' > '/etc/bash_completion.d/task'
|
||||
|
||||
```sh
|
||||
task 'assets' 'build'
|
||||
task --dry 'bootstrap'
|
||||
```
|
||||
|
||||
If task names are omitted, a task named `default` will be assumed.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^19.4.0",
|
||||
"@commitlint/config-conventional": "^19.2.2"
|
||||
"@commitlint/cli": "^19.5.0",
|
||||
"@commitlint/config-conventional": "^19.5.0",
|
||||
"@evilmartians/lefthook": "^1.8.2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user