ziplocalgit
v2.0.2
Published
Command line tool to zip the local git repository
Readme
ziplocalgit
Zip local git repository, used for student submissions
This small library provides a command line tool in order to zip the local git repository. It is used in the context of a university class in which students have to submit their solutions by means of a zip file containing the local git repository. The idea behind that is, that instead of simply creating a zip of the solution, git is to be used and, more importantly, the lecturer gets all the git logs in order to improve check of copies. Error messages are emitted in German language at the moment.
Install
Install with npm:
npm install --save-dev ziplocalgitUsage
Usage: ziplocalgit zip [options]
Create a zip file with local git (.git)
Usually you want to create a script in package.json, e.g.
"scripts": {
"abgabe": "npx ziplocalgit -f abgabe_Blatt_0"
}General options
| Option | Description | Default |
|-------------|----------------|---------|
| --verbose | Verbose output | false |
| --debug | Debug output | false |
| --quiet | Quiet output | false |
Commands
zip
Create a zip file containing the local git repository (.git folder) for student submission. Checks that all changes are committed and warns if the resulting file is unusually small or large.
| Option | Description | Default |
|---------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
| -f, --filename <filename> | Name of the zip file; use ${CWD} as placeholder for the current folder name | abgabe_${CWD}.zip |
| --noCommitCheck | Do not check that all files are committed | false |
| --noOverwrite | Do not overwrite an existing submission zip | false |
| --minsize <minsize> | Emit a warning if the zip file size is less than this value (in kByte) | 20 |
| --maxsize <maxsize> | Emit a warning if the zip file size is greater than this value (in kByte) | 2000 |
| --addCopilotHistory | Add the Copilot chat history file to the zip | false |
| --copilotHistoryFilename <filename> | Name of the exported Copilot history file added to the zip | copilot_chat_history.md |
| --noRemote | Do not search remote locations (Dev Container or WSL) as fallback when no direct workspace storage match is found | false |
| --enforceRemote | Enforce searching remote locations even when a direct workspace storage match is found | false |
| --remotePath <string> | Prefix in the remote container (e.g. /home/dev for absolute path /home/dev/workspace, or projects for relative path matching **/projects/workspace); if empty, all workspaces matching the folder name are considered | "" |
| --remoteType <string> | Filter for the type of remote environment, e.g. dev-container or wsl | "" |
Dependencies
- adm-zip
- Until version 1.0.3, bestzip has been used. Alas that package has some dependencies which caused security warnings.
- commander.js
Status
This library is developed on demand. It only contains features as far as needed by the author. It is basically made public in order to simplify the author's scripts.
License
This program and the accompanying materials are made available under the terms of the Eclipse Public License v. 2.0 which is available at https://www.eclipse.org/legal/epl-2.0.
