Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add link command #107

Merged
merged 7 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Link

on:
push:
branches:
- master
paths:
- '**.yml'
- lisp/**
- cmds/**
- src/**
- test/**
pull_request:
branches:
- master
paths-ignore:
- '**.md'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
emacs-version:
- 26.3
- 27.2
- 28.2
- snapshot

steps:
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}

- uses: actions/checkout@v3

- name: Prepare Eask (Unix)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
chmod -R 777 ./
.github/scripts/setup-eask

- name: Prepare Eask (Windows)
if: matrix.os == 'windows-latest'
run: .github/scripts/setup-eask.ps1

- name: Testing...
run: |
make command-link

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
* Add command to clean pkg-file (#99)
* Add option `-o`/`--output` to output log for Eask checker (#100)
* Fix line-endings for unix system (#106)
* Add `link` command (#107)

## 0.7.x
> Released Sep 08, 2022
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ command-outdated-upgrade:
command-search:
./test/commands/search/run.sh

command-link:
./test/commands/link/run.sh

test-ert:
./test/commands/test/ert/run.sh

Expand Down
33 changes: 33 additions & 0 deletions cmds/core/link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright (C) 2023 Jen-Chieh Shen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

"use strict";

exports.command = ['link <action>'];
exports.desc = 'Manage links';
exports.builder = function (yargs) {
return yargs
.usage(`${exports.desc}

Usage: eask link <command> [options..]`)
.commandDir('../link/')
.demandCommand();
};

exports.handler = async (argv) => { };
39 changes: 39 additions & 0 deletions cmds/link/add.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Copyright (C) 2023 Jen-Chieh Shen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

"use strict";

exports.command = ['add <name> <path>'];
exports.desc = 'Link a local package';
exports.builder = {
name: {
description: 'name of the link',
requiresArg: true,
type: 'string',
},
path: {
description: 'location (target package) where you want to link',
requiresArg: true,
type: 'string',
},
};

exports.handler = async (argv) => {
await UTIL.e_call(argv, 'link/add', argv.name, argv.path);
};
34 changes: 34 additions & 0 deletions cmds/link/delete.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Copyright (C) 2023 Jen-Chieh Shen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

"use strict";

exports.command = ['delete [names..]'];
exports.desc = 'Delete local linked packages';
exports.builder = {
names: {
description: 'name of the link, accept array',
requiresArg: false,
type: 'array',
},
};

exports.handler = async (argv) => {
await UTIL.e_call(argv, 'link/delete', argv.names);
};
27 changes: 27 additions & 0 deletions cmds/link/list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright (C) 2023 Jen-Chieh Shen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

"use strict";

exports.command = ['list'];
exports.desc = 'List all project links';

exports.handler = async (argv) => {
await UTIL.e_call(argv, 'link/list');
};
57 changes: 29 additions & 28 deletions docs/content/en/Getting Started/Basic Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,23 @@ Eask is a command-line tool that helps you build, lint, and test Emacs Lisp pack
Usage: eask <command> [options..]

Commands:
archives List out all package archives [aliases: sources]
archives List out all package archives [aliases: sources]
autoloads Generate autoloads file
clean <type> Delete various files produced during building
compile [names..] Byte compile all Emacs Lisp files in the package
concat [names..] Concatenate elisp files [aliases: concatenate]
concat [names..] Concatenate elisp files [aliases: concatenate]
create <type> Create a new elisp project
emacs [args..] Execute emacs with the appropriate environment
eval [form] Evaluate lisp form with a proper PATH
path Print the PATH (exec-path) from workspace [aliases: exec-path]
path Print the PATH (exec-path) from workspace [aliases: exec-path]
exec [args..] Execute command with correct environment PATH set up
files Print the list of all package files
info Display information about the current package
init Create new Eask file in current directory
install-deps Automatically install package dependencies [aliases: install-dependencies, prepare]
install-deps Automatically install package dependencies [aliases: install-dependencies, prepare]
install [names..] Install packages
keywords List available keywords that can be used in the header section
link <action> Manage links
lint <type> Run linter
list List packages
load-path Print the load-path from workspace
Expand All @@ -54,39 +55,39 @@ Commands:
recipe Suggest a recipe format
refresh Download package archives
reinstall [names..] Reinstall packages
run [names..] Run the script named [names..] [aliases: run-script]
run [names..] Run the script named [names..] [aliases: run-script]
search [queries..] Search packages
test <type> Run test
uninstall [names..] Uninstall packages [aliases: delete]
uninstall [names..] Uninstall packages [aliases: delete]
upgrade [names..] Upgrade packages
check-eask [files..] Run eask checker
locate Print out Eask installed location
upgrade-eask Upgrade Eask itself [aliases: upgrade-self]
upgrade-eask Upgrade Eask itself [aliases: upgrade-self]

Proxy Options:
--proxy update proxy for HTTP and HTTPS to host [string]
--http-proxy update proxy for HTTP to host [string]
--https-proxy update proxy for HTTPS to host [string]
--no-proxy set no-proxy to host [string]
--proxy update proxy for HTTP and HTTPS to host [string]
--http-proxy update proxy for HTTP to host [string]
--https-proxy update proxy for HTTPS to host [string]
--no-proxy set no-proxy to host [string]

Options:
--version show version number [boolean]
--help show usage instructions [boolean]
-g, --global change default workspace to ~/.emacs.d/ [boolean]
-a, --all enable all flag [boolean]
-q, --quick start cleanly without loading the configuration files [boolean]
-f, --force enable force flag [boolean]
--development, --dev turn on development mode [boolean]
--debug turn on debug mode [boolean]
--strict report error instead of warnings [boolean]
--allow-error continue the executioon even there is error reported [boolean]
--insecure allow insecure connection [boolean]
--timestamps log with timestamps [boolean]
--log-level log with level [boolean]
--log-file, --lf generate log files [boolean]
--elapsed-time, --et show elapsed time between each operation [boolean]
--no-color disable color output [boolean]
-v, --verbose set verbosity from 0 to 4 [number]
--version show version number [boolean]
--help show usage instructions [boolean]
-g, --global change default workspace to ~/.emacs.d/ [boolean]
-a, --all enable all flag [boolean]
-q, --quick start cleanly without loading the configuration files [boolean]
-f, --force enable force flag [boolean]
--development, --dev turn on development mode [boolean]
--debug turn on debug mode [boolean]
--strict report error instead of warnings [boolean]
--allow-error continue the executioon even there is error reported [boolean]
--insecure allow insecure connection [boolean]
--timestamps log with timestamps [boolean]
--log-level log with level [boolean]
--log-file, --lf generate log files [boolean]
--elapsed-time, --et show elapsed time between each operation [boolean]
--no-color disable color output [boolean]
-v, --verbose set verbosity from 0 to 4 [number]

For more information, find the manual at https://emacs-eask.github.io/
```
Expand Down
Loading