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

Add function install() #4

Closed
ufechner7 opened this issue Sep 17, 2022 · 5 comments · Fixed by #8
Closed

Add function install() #4

ufechner7 opened this issue Sep 17, 2022 · 5 comments · Fixed by #8
Labels
enhancement New feature or request

Comments

@ufechner7
Copy link

Add a function that copies the required script at the suggested location.

Should be trivial for Linux.

@petvana petvana added the enhancement New feature or request label Sep 18, 2022
@ufechner7
Copy link
Author

You can find an example here: https://github.com/ufechner7/Plotting/blob/main/bin/install

@petvana
Copy link
Owner

petvana commented Sep 18, 2022

Here, I'd prefer Julia function, i.e., AutoSysimages.install().

@ufechner7
Copy link
Author

ufechner7 commented Sep 18, 2022

Yes, Julia is cross platform, thats better...

Some example code from another project of me:

function cp_examples()
    PATH = "examples"
    src_path = joinpath(dirname(pathof(@__MODULE__)), "..", PATH)
    copy_files("examples", readdir(src_path))
end

function copy_files(relpath, files)
    if ! isdir(relpath) 
        mkdir(relpath)
    end
    src_path = joinpath(dirname(pathof(@__MODULE__)), "..", relpath)
    for file in files
        cp(joinpath(src_path, file), joinpath(relpath, file), force=true)
        chmod(joinpath(relpath, file), 0o774)
    end
    files
end

@petvana
Copy link
Owner

petvana commented Sep 18, 2022

I've drafted a PR. Btw, the chmod seems not necessary.

@ufechner7
Copy link
Author

ufechner7 commented Sep 18, 2022

I also drafted a PR, but you were faster and a bit better...
Small remark: There is a typo in the title of your PR, it should be install() and not instal().

@petvana petvana linked a pull request Sep 18, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants