File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env nu
22
33def --wrapped main [... rest ] {
4- nu - c $' use toolkit.nu; toolkit ($rest | str join (char space ))'
4+ const pathToSelf = path self
5+ let nameOfSelf = $pathToSelf | path parse | get stem
6+ if $rest in [ [-h ] [--help ] ] {
7+ ^$nu.current-exe -c $' use ($pathToSelf ); scope modules | where name == ($nameOfSelf ) | get 0.commands.name'
8+ } else {
9+ ^$nu.current-exe -c $' use ($pathToSelf ); ($nameOfSelf ) ($rest | str join (" " ))'
10+ }
511}
612
7- export def pull [problemNumber ] {
13+ export def download-challenge [problemNumber ] {
14+ const path_to_src_folder = [(path self ) .. project_euler ] | path join
815 let file = http get $" https://projecteuler.net/problem=($problemNumber )"
916 | parse ' <title>#{number} {title} - Project Euler</title>'
1017 | get title.0
1118 | str snake-case
1219 | {
13- parent : project_euler
20+ parent : $path_to_src_folder
1421 stem : $" test_pe($problemNumber )_($in )"
1522 extension : py
1623 }
You can’t perform that action at this time.
0 commit comments