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

Remove the alias foal run-script of foal run. #1281

Merged
merged 2 commits into from
Aug 22, 2024
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
3 changes: 2 additions & 1 deletion docs/blog/version-5.0-release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ Version 5.0 of [Foal](https://foalts.org/) is out!

## Removal of depreacted components

- The deprecated hook `@Log` has been removed. To replace it, you can use the `Logger` service in a custom `@Hook`.
- The deprecated hook `@Log` has been removed. To replace it, you can use the `Logger` service in a custom `@Hook`.
- The command alias `npx foal run-script` has been removed. Use `npx foal run` instead.
2 changes: 1 addition & 1 deletion docs/docs/cli/shell-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ npm run build
Then you can execute it with this command:

```shell
npx foal run my-script # or npx foal run-script my-script
npx foal run my-script
```

> You can also provide additionnal arguments to your script (for example: `npx foal run my-script foo=1 bar='[ 3, 4 ]'`). The default template in the generated scripts shows you how to handle such behavior.
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"scripts": {
"test": "npm run test:generators && npm run test:run-script && npm run test:create-secret && npm run test:rmdir && npm run test:fs",
"test": "npm run test:generators && npm run test:run && npm run test:create-secret && npm run test:rmdir && npm run test:fs",
"test:fs": "mocha --file \"./src/test.ts\" --require ts-node/register \"./src/generate/file-system.spec.ts\"",
"dev:test:fs": "mocha --file \"./src/test.ts\" --require ts-node/register --watch --extension ts \"./src/generate/file-system.spec.ts\"",
"test:generators": "mocha --file \"./src/test.ts\" --require ts-node/register \"./src/generate/generators/**/*.spec.ts\"",
"dev:test:generators": "mocha --file \"./src/test.ts\" --require ts-node/register --watch --extension ts \"./src/generate/generators/**/*.spec.ts\"",
"test:rmdir": "mocha --file \"./src/test.ts\" --require ts-node/register \"./src/rmdir/**/*.spec.ts\"",
"dev:test:rmdir": "mocha --file \"./src/test.ts\" --require ts-node/register --watch --extension ts \"./src/rmdir/**/*.spec.ts\"",
"test:run-script": "mocha --file \"./src/test.ts\" --require ts-node/register \"./src/run-script/**/*.spec.ts\"",
"dev:test:run-script": "mocha --file \"./src/test.ts\" --require ts-node/register --watch --extension ts \"./src/run-script/**/*.spec.ts\"",
"test:run": "mocha --file \"./src/test.ts\" --require ts-node/register \"./src/run/**/*.spec.ts\"",
"dev:test:run": "mocha --file \"./src/test.ts\" --require ts-node/register --watch --extension ts \"./src/run/**/*.spec.ts\"",
"test:create-secret": "mocha --file \"./src/test.ts\" --require ts-node/register \"./src/create-secret/**/*.spec.ts\"",
"dev:test:create-secret": "mocha --file \"./src/test.ts\" --require ts-node/register --watch --extension ts \"./src/create-secret/**/*.spec.ts\"",
"build": "rimraf lib && tsc -p tsconfig-build.json && copyfiles -a -u 3 \"src/generate/templates/**/*\" lib/generate/templates",
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from './generate';
import { ClientError } from './generate/file-system';
import { rmdir } from './rmdir';
import { runScript } from './run-script';
import { runScript } from './run';

function displayError(...lines: string[]): void {
console.error();
Expand Down Expand Up @@ -67,7 +67,6 @@ program
program
.command('run')
.argument('<name>', 'Name of the script to run')
.alias('run-script')
.description('Run a shell script.')
.action((name: string) => {
runScript({ name }, process.argv);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { getCommandLineArguments } from './get-command-line-arguments.util';

describe('getCommandLineArguments', () => {
it('should convert the arguments to an object.', () => {
// npx foal run-script foo foo=barfoo bar='hello world'
// npx foal run foo foo=barfoo bar='hello world'
const argv = [
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/node',
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/foal',
'run-script',
'run',
'my-script',
'prod',
'foo=barfoo',
Expand All @@ -28,7 +28,7 @@ describe('getCommandLineArguments', () => {
const argv = [
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/node',
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/foal',
'run-script',
'run',
'my-script',
'bar={ "foo": "bar" }',
'foo=3'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('runScript', () => {
await runScript({ name: 'my-script' }, [
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/node',
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/foal',
'run-script',
'run',
'my-script',
'email=bar',
'n=11'
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('runScript', () => {
await runScript({ name: 'my-script' }, [
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/node',
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/foal',
'run-script',
'run',
'my-script',
'foo=bar',
]);
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('runScript', () => {
await runScript({ name: 'my-script' }, [
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/node',
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/foal',
'run-script',
'run',
'my-script',
'foo=bar',
]);
Expand Down Expand Up @@ -178,7 +178,7 @@ describe('runScript', () => {
await runScript({ name: 'my-script' }, [
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/node',
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/foal',
'run-script',
'run',
'my-script',
], log);

Expand All @@ -201,7 +201,7 @@ describe('runScript', () => {
await runScript({ name: 'my-script' }, [
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/node',
'/Users/loicpoullain/.nvm/versions/node/v8.11.3/bin/foal',
'run-script',
'run',
'my-script',
], log);

Expand Down
Loading