# Copyright (c) 2026, UChicago Argonne, LLC
# BSD OPEN SOURCE LICENSE. Full license can be found in LICENSE
# Copyright (c) 2026, UChicago Argonne, LLC
# BSD OPEN SOURCE LICENSE. Full license can be found in LICENSE
from ..supply_editor import LinkReverter
from ..common_tools import running_on_ci


def link_revert(proj):
    if not proj.open_mode:
        proj.show_message_no_supply()
        return
    res = LinkReverter(proj)
    if running_on_ci():
        return res
    res.do_revert_link()
