GithubHelp home page GithubHelp logo

Comments (6)

nkakouros avatar nkakouros commented on July 27, 2024 1

After sourcing the Bash Infinity modules you want (at least the lib/oo-bootstrap.sh file), you can have:

unalias "import"

You can use the . alias to keep using Bash Infinity's import functionality.

from bash-oo-framework.

nkakouros avatar nkakouros commented on July 27, 2024 1

oo-bootstrap.sh sets three relevant aliases:

alias import="__oo__allowFileReloading=false System::Import"

alias source="__oo__allowFileReloading=true System::ImportOne"

alias .="__oo__allowFileReloading=true System::ImportOne"

The first one can import many files at once, skipping the ones that are already loaded. The other two source a file no matter what.

After sourcing oo-bootstrap.sh, you can:

unalias '.'
alias .="__oo__allowFileReloading=false System::Import"

to have '.' do what 'import' did.

You can do this right after sourcing the bootstrap file.

from bash-oo-framework.

ukos-git avatar ukos-git commented on July 27, 2024

If I understand correctly, I could unalias the import from lib/oo-bootstrap.sh right after using import util/exception.

But I will have to redirect the import binary from imagemagick in the first place. Because now, if I call import after sourcing the file from lib/oo-bootstrap.sh, imagemagick is triggered.

You can use the . alias to keep using Bash Infinity's import functionality.

I did not get that part.

from bash-oo-framework.

ukos-git avatar ukos-git commented on July 27, 2024

You pointed me in the right direction:
instead of

import util/exception

one can use

__oo__allowFileReloading=false System::Import util/exception

from bash-oo-framework.

nkakouros avatar nkakouros commented on July 27, 2024

BTW, this might had been the actual reason for the aliases not working.

from bash-oo-framework.

reuvenpo avatar reuvenpo commented on July 27, 2024

Wouldn't

alias .=$(alias import)

or similar, be better than the explicit

unalias '.'
alias .="__oo__allowFileReloading=false System::Import"

?

Will be more robust and less "leaky" in terms of encapsulation too.

from bash-oo-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.