Skip to content

Commit 0e96a8f

Browse files
authored
Merge pull request #41 from RISC-OS-Community/develop
Cumulative set of merges from Develop to Main branch
2 parents 2e7c3ec + 92bb7ea commit 0e96a8f

File tree

4 files changed

+318
-0
lines changed

4 files changed

+318
-0
lines changed

.rocog/scripts/ros2win

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
###################
4+
# name: ros2win
5+
# description: Simple script to generate a MS Windows firendly source
6+
# file from a RISC OS source file.
7+
# author: Paolo Fabio Zaino
8+
# license: Copyright by Paolo Fabio Zaino, all rights reserved
9+
# distributed under CDDL v1.1
10+
#
11+
# Long description:
12+
# This script can be used to generate a MS Windows friendly source file
13+
# from a RISC OS source file, where the \n is enriched with \r.
14+
# This is useful when you want to use a Windows editor to edit
15+
# RISC OS source files.
16+
####################
17+
18+
path1="$1"
19+
path2="$2"
20+
21+
# Display command usage:
22+
function usage()
23+
{
24+
echo "Usage: ros2win [path1] [path2]"
25+
echo "path1: path to the file to convert"
26+
echo "path2: path to the converted file"
27+
echo "Example: ros2win ./src/!Mk/Makefile ./src/!Mk/Makefile"
28+
echo ""
29+
echo "If path2 is not specified then the converted file will be"
30+
echo "saved in the same directory as path1 with the same name"
31+
}
32+
33+
if [ "${path1}" == "" ]
34+
then
35+
usage
36+
exit 1
37+
fi
38+
39+
if [ ! -f "${path1}" ]
40+
then
41+
echo "Error: ${path1} is not a file"
42+
exit 1
43+
fi
44+
45+
if [ "${path2}" == "" ]
46+
then
47+
path2="${path1}"
48+
fi
49+
50+
awk 'sub("$", "\r")' ${path1} > ${path2}
51+
52+
exit $?

.rocog/scripts/win2ros

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
###################
4+
# name: win2ros
5+
# description: Simple script to generate a RISC OS firendly source
6+
# file from a Windows source file.
7+
# author: Paolo Fabio Zaino
8+
# license: Copyright by Paolo Fabio Zaino, all rights reserved
9+
# distributed under CDDL v1.1
10+
#
11+
# Long description:
12+
# This script can be used to generate a RISC OS friendly source file
13+
# from a Windows source file, where the \n\r is replaced with \n.
14+
# This is useful when you want to use a Windows editor to edit
15+
# RISC OS source files.
16+
####################
17+
18+
path1="$1"
19+
path2="$2"
20+
21+
# Display command usage:
22+
function usage()
23+
{
24+
echo "Usage: win2ros [path1] [path2]"
25+
echo "path1: path to the file to convert"
26+
echo "path2: path to the converted file"
27+
echo "Example: win2ros ./src/!Mk/Makefile ./src/!Mk/Makefile"
28+
echo ""
29+
echo "If path2 is not specified then the converted file will be"
30+
echo "saved in the same directory as path1 with the same name"
31+
}
32+
33+
if [ "${path1}" == "" ]
34+
then
35+
usage
36+
exit 1
37+
fi
38+
39+
if [ ! -f "${path1}" ]
40+
then
41+
echo "Error: ${path1} is not a file"
42+
exit 1
43+
fi
44+
45+
if [ "${path2}" == "" ]
46+
then
47+
path2="${path1}"
48+
fi
49+
50+
awk '{ sub("\r$", ""); print }' ${path1} > ${path2}
51+
52+
exit $?

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ This repository is organised in multiple "levels":
1919

2020
Everyone is welcome to help us to improve this repository and the resources list (as well as proposing more ideas for the meetings!). Also, we are always seeking for people willing to provide courses, presentations and/or sharing your experience coding on RISC OS.
2121

22+
More info and details [here](docs/RISCOSCodingHowToMakeVideos.md) for who wish to help us with the videos.
23+
2224
### How to contribute
2325

2426
Follow the general instructions [here](CONTRIBUTING.md) and update the documents in `doc` directory as you feel appropriate. When done open a `Pull Request` to the `develop` branch and ask for a review from `RISC-OS-Community/code-reviews-team` so we can review your changes and approve them, thanks!

0 commit comments

Comments
 (0)