Amrit Shrestha
Amrit Shrestha

Reputation: 1660

Invoke function from another function in fishshell

I have created two function in .fish file

function mysqlstart
    cd ~/Projects/mysql
    docker-compose up -d
end

function projstart
    cd ~/Projects/projectName/
    php artisan serve
end

I want to invoke those two functions with a single function so that I don't have to type two alias on fish shell.

function startdev
    mysqlstart()
    projstart()
end

How to call functions from another function in .fish file?

I know I can run all four commands inside stardev function itself. But if I can call other functions, I can do other things as well and keep the .fish file DRY.

Upvotes: 0

Views: 499

Answers (1)

ridiculous_fish
ridiculous_fish

Reputation: 18551

Functions are just like any other command:

function startdev
    mysqlstart
    projstart
end

Easy!

Upvotes: 3

Related Questions